Giter Site home page Giter Site logo

Comments (2)

thecodrr avatar thecodrr commented on June 1, 2024

Here are the benchmark results with all filtering done after the crawling:

Running "Synchronous (2642 files, 330 folders)" suite...

  fdir simple sync:
    291 ops/s, ±0.42%   | fastest

  fdir filter sync:
    281 ops/s, ±0.32%   | 3.44% slower

  fdir glob sync:
    257 ops/s, ±0.48%   | slowest, 11.68% slower

  fdir filter after sync:
    272 ops/s, ±1.86%   | 6.53% slower

  fdir glob after sync:
    266 ops/s, ±0.47%   | 8.59% slower

Running "Asynchronous (2642 files, 330 folders)" suite...

  fdir simple async:
    464 ops/s, ±2.46%   | fastest

  fdir filter async:
    445 ops/s, ±2.24%   | 4.09% slower

  fdir glob async:
    386 ops/s, ±2.42%   | slowest, 16.81% slower

  fdir filter after async:
    431 ops/s, ±2.35%   | 7.11% slower

  fdir glob after async:
    397 ops/s, ±2.28%   | 14.44% slower

Not a huge difference. Filtering is 2x slower if we do it after while we gain about ~3% if we do globbing after. Hm...

Edit: These results are borked as I made a mistake with how picomatch was being initialized in different tests.

from fdir.

thecodrr avatar thecodrr commented on June 1, 2024

It would be cool to add picomatch caching at a global level so a single picomatch instance will be used across multiple fdir instances provided they have the exact same patterns. This would be a huge performance boost.

from fdir.

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.