Code Monkey home page Code Monkey logo

Comments (9)

jzaefferer avatar jzaefferer commented on September 12, 2024 2

@ljharb yep, it does

from eslint-plugin-import.

ljharb avatar ljharb commented on September 12, 2024 1

What happens if you set the disableScc option to true? Does it restore the v2.29 speed?

cc @soryy708

from eslint-plugin-import.

soryy708 avatar soryy708 commented on September 12, 2024 1

IMO it's a good heuristic because:

  • If your project is small, lint takes seconds, so you don't care about performance as much, don't mind the overhead
  • If your project is large, lint takes minutes, so you care about performance, and want more efficiency

Defaults that cater to large codebases (perhaps at the expense of tiny ones) are good, while there is an escape hatch in case the user cares enough.

from eslint-plugin-import.

diegodorado avatar diegodorado commented on September 12, 2024

Same for me: it is worse now. Went from

Rule                                 | Time (ms) | Relative
:------------------------------------|----------:|--------:
import/no-cycle                      |  5091.198 |    31.2%

to

Rule                                 | Time (ms) | Relative
:------------------------------------|----------:|--------:
import/no-cycle                      |  6829.761 |    39.1%

from eslint-plugin-import.

soryy708 avatar soryy708 commented on September 12, 2024

Cool, glad we decided to put disableScc in.

The SCC is a pre-processing we do to speed up no-cycle to enable early-exit (short-circuiting). In large projects with many files to lint, it prunes a lot of unnecessary work, but in small projects the preprocessing can take longer than the time it saves.

from eslint-plugin-import.

ljharb avatar ljharb commented on September 12, 2024

Is there any way we could figure out a heuristic, and dynamically figure out whether it’ll be faster to use scc or not?

from eslint-plugin-import.

soryy708 avatar soryy708 commented on September 12, 2024

Is there any way we could figure out a heuristic, and dynamically figure out whether it’ll be faster to use scc or not?

I don't have anything in mind. It depends on a lot of things - the user's hardware, cpu, how fast their hdd/ssd is...

If the heuristic will be right then great, the user won't need to configure anything.

But what if the heuristic will be wrong? They'll need to override the heuristic's decision, either to enable or to disable SCC.

from eslint-plugin-import.

ljharb avatar ljharb commented on September 12, 2024

That’s already the case - we just chose a heuristic of “always use scc”. The hope would be do minimize how many users have to enable or disable scc explicitly.

from eslint-plugin-import.

ljharb avatar ljharb commented on September 12, 2024

I totally agree that it's the right heuristic :-) i'm just wondering if we can fine-tune it a bit for projects in the 20-70s range.

from eslint-plugin-import.

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.