Code Monkey home page Code Monkey logo

Comments (7)

nicoespeon avatar nicoespeon commented on July 18, 2024 1

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.

maxpatiiuk avatar maxpatiiuk commented on July 18, 2024

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:
MicrosoftTeams-image

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.

nicoespeon avatar nicoespeon commented on July 18, 2024

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.

dinofx avatar dinofx commented on July 18, 2024

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.

nicoespeon avatar nicoespeon commented on July 18, 2024

@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.

j4k0xb avatar j4k0xb commented on July 18, 2024

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.

nicoespeon avatar nicoespeon commented on July 18, 2024

@j4k0xb true. A size limit would certainly be smarter indeed 🤔

from abracadabra.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.