Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow init/require #314

Closed
chyzwar opened this issue May 28, 2021 · 1 comment
Closed

Slow init/require #314

chyzwar opened this issue May 28, 2021 · 1 comment

Comments

@chyzwar
Copy link

chyzwar commented May 28, 2021

Environment

  • OS Version: ubuntu 20.04
  • Node.js Version: 16.0.0

Actual behavior

var glob = require("fast-glob");
console.log('glob', glob)
$ time node index.js 
glob [AsyncFunction: FastGlob] {
  sync: [Function: sync],
  stream: [Function: stream],
  generateTasks: [Function: generateTasks],
  isDynamicPattern: [Function: isDynamicPattern],
  escapePath: [Function: escapePath]
}

real    0m0,127s
user    0m0,090s
sys     0m0,013s

time node index.js

Expected behavior

Should have similar require time as glob package.

var glob = require("glob");
console.log('glob', glob)
time node index.js
glob <ref *1> [Function: glob] {
  sync: [Function: globSync] { GlobSync: [Function: GlobSync] },
  GlobSync: [Function: GlobSync],
  glob: [Circular *1],
  hasMagic: [Function (anonymous)],
  Glob: [Function: Glob]
}

real    0m0,082s
user    0m0,065s
sys     0m0,015s

Steps to reproduce

create index.js file and time execution time.
When using fast-glob in cli tools, require/init time is dominating runtime performance. Only when globing large directories, fast-glob is faster. fast-glob is slower by 50ms when starting process.

@mrmlnc
Copy link
Owner

mrmlnc commented Nov 8, 2023

Some performance optimizations merged into the main branch.

#428

@mrmlnc mrmlnc closed this as completed Nov 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants