Comments (7)
The new option abracadabra.getMaxFileSizeKb
should help with that. IMO, we now have plenty of options and sensible defaults that should address this.
However, feel free to re-open if you still experience bad performances because of Abracadabra.
from abracadabra.
Seeing very bad performance when doing "Go to definition" in a large typescript definitions file (115k lines):
out.mp4
When trying to save, I get this:
Using VS Code's extension bisect, found that Abracadabra is the cause - when it is disabled, performance in the 115k line file is awesome
from abracadabra.
Thanks for reporting. To be honest, I'm not surprised. I didn't have perfs in mind when I started implementing these refactorings.
It was working fine on files of reasonable size at first. The more refactorings we added to the catalog, the worse the perfs went, especially on large files. The exclusion feature was supposed to help, but it doesn't seem to.
We have had other obvious instances of this (see #416) and I believe something like #836 would be the solution. I haven't taken the time to dig into it, but I will think about it. In the meantime, https://marketplace.visualstudio.com/items?itemName=p42ai.refactor may be a better alternative so you have a catalog of refactorings, but with better perfs (I think).
from abracadabra.
A simple short-term solution might be to disable the feature for files above a certain size. I think I've seen code-folding or some other feature take this approach with a 1-time popup indicating that it self-disabled due to file size.
from abracadabra.
@dinofx that's a great idea!
I just shipped a release that contains a new setting abracadabra.maxFileLinesCount
which should do that: don't evaluate refactorings based on the size of the file. It's configurable, but I put a 10,000 LOC default. If you can give it a try, let me know if that resolves your issue with the large bundles 🤞
I also made changes that reduced the bundle size quite a lot for the latest release. I think that should also help: #934
from abracadabra.
The goal is to reduce the impact on performance when you have a large file (eg. a bundle) in your codebase.
I often open large bundles, but the problem is that they are minified and therefore 1 line long.
How about a size limit (e.g. in kb/mb) instead of LOC?
from abracadabra.
@j4k0xb true. A size limit would certainly be smarter indeed 🤔
from abracadabra.
Related Issues (20)
- Automatically "Convert to Template String" if we write ${} in a string HOT 2
- Abracadabra does not play nice with cursorless HOT 29
- Inlining JSX removes curly braces HOT 1
- Extract refactoring runs on JSX attribute HOT 3
- Inline async arrow function misses braces HOT 1
- Abracadabra replaces system key binding HOT 3
- Extract Variable insert position doesn't right HOT 2
- change activationEvent to onLanguage
- Idea: Migrate to TypeScript plugin HOT 4
- "Change Signature" doesn't work on a nested function HOT 3
- "Add explicit type" refactoring HOT 1
- Inline variable if ternary misses parens HOT 5
- split declaration & init when working inside class
- JS and TS code without `;` is broken after refactoring HOT 3
- More inline variable missing parentheses edge-cases HOT 1
- Can't move class to an existing file HOT 2
- Move to new file: configure case of the new filename HOT 3
- Upgrade babel/traverse ti eliminate vulnerability. HOT 1
- Convert to Arrow Function: Does not work with a `export default function` HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from abracadabra.