Giter Site home page Giter Site logo

Add default concurrency limit about del HOT 6 OPEN

sindresorhus avatar sindresorhus commented on August 12, 2024
Add default concurrency limit

from del.

Comments (6)

evocateur avatar evocateur commented on August 12, 2024

Do you have any preferred benchmarking tools, or would repeated runs of a shell script calling time del packages/*/node_modules in a bootstrapped repo suffice?

from del.

sindresorhus avatar sindresorhus commented on August 12, 2024

I usually use https://github.com/logicalparadox/matcha

Example: https://github.com/sindresorhus/strip-json-comments/blob/254d84a3826b3a7acba8dc484660a97c43dca821/package.json#L17 https://github.com/sindresorhus/strip-json-comments/blob/254d84a3826b3a7acba8dc484660a97c43dca821/benchmark.js

from del.

nexdrew avatar nexdrew commented on August 12, 2024

Would a default of require('os').cpus().length (or some derivative thereof) be too naive?

from del.

evocateur avatar evocateur commented on August 12, 2024

from del.

nexdrew avatar nexdrew commented on August 12, 2024

I took an initial stab at creating a matcha benchmark test. You can find it in the benchmark branch of my fork.

I'm probably doing something wrong, but I don't think these tests show an appreciable difference between different concurrency settings. Here's an example run on my machine:

screen shot 2017-06-09 at 2 34 22 pm

Note that in the initial version of these tests, the first actual deletion has to find and delete half of the 1000 created files, and the last actual deletion deletes the other half.

Let me know if this looks helpful at all. Comments welcomed.

from del.

frank-dspeed avatar frank-dspeed commented on August 12, 2024

the benchmarks are fals and you should not optimize that with a concurrency limit as a engine author i can tell you that this is part of v8 already you simply fire your stack of actions in and it takes care of the rest everything else will not be the same as your tests include filesystem operations that take time too

and they depend on the write and delete methods that the filesystem uses and so on

to test the raw performance it would be enough to test how many actions you can fire so how many fsCalls you can put on the stack and again that is also optimized by v8 it self and nodejs abstracts that and maybe makes that even more buggy via its libuv integration the loop is bound to both v8 and libuv which does the I/O processing between the OS and the c code that calls v8

from del.

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.