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

A very long initialization time of filters (deep + entry) #92

Closed
mrmlnc opened this issue Apr 7, 2018 · 5 comments
Closed

A very long initialization time of filters (deep + entry) #92

mrmlnc opened this issue Apr 7, 2018 · 5 comments

Comments

@mrmlnc
Copy link
Owner

mrmlnc commented Apr 7, 2018

Environment

  • OS Version: macOS 10.13.3
  • Node.js Version: 8.9.0

Source

The problem

We have to figure out a way to reduce the initialization time of filters. Something like 14ms for the following tasks:

{ base: 'src/types/one',
  dynamic: true,
  patterns: [ 'src/types/one/*/sub/y/y.json' ],
  positive: [ 'src/types/one/*/sub/y/y.json' ],
  negative: [] }
Prepare reader options: 8.445ms
{ base: 'src/types/two',
  dynamic: true,
  patterns: [ 'src/types/two/*/sub/y/y.json' ],
  positive: [ 'src/types/two/*/sub/y/y.json' ],
  negative: [] }
Prepare reader options: 1.802ms
{ base: 'src/types/three',
  dynamic: true,
  patterns: [ 'src/types/three/*/sub/y/y.json' ],
  positive: [ 'src/types/three/*/sub/y/y.json' ],
  negative: [] }
Prepare reader options: 1.400ms
{ base: 'src/types/four',
  dynamic: true,
  patterns: [ 'src/types/four/*/sub/y/y.json' ],
  positive: [ 'src/types/four/*/sub/y/y.json' ],
  negative: [] }
Prepare reader options: 0.794ms
{ base: 'src/types/five',
  dynamic: true,
  patterns: [ 'src/types/five/*/sub/y/y.json' ],
  positive: [ 'src/types/five/*/sub/y/y.json' ],
  negative: [] }
Prepare reader options: 2.111ms
@mrmlnc mrmlnc self-assigned this Apr 7, 2018
@mrmlnc mrmlnc added this to the next milestone Apr 7, 2018
@mrmlnc
Copy link
Owner Author

mrmlnc commented Apr 8, 2018

[globby@7]: 14 ms

Tasks: 1.297ms
Prepare reader options: 22.569ms
Reader: 44.372ms
Transformer: 0.115ms
[fast-glob]: 69 ms

@jonschlinkert
Copy link

jonschlinkert commented Apr 8, 2018

I mentioned this on the linked issue, but I want to get this fixed.

I also noticed this the other day before the referenced issue was created, then @doowb and I discussed it on a call. When I initially published v3 of micromatch, I thought it took something like 30ms.

edit: which I still was not happy with.

@jonschlinkert
Copy link

Ok, I know what's happening, and I know why it manifested recently.

Problem: On both Snapdragon and micromatch libraries, we've been upgrading dependencies to newer versions. This is causing a bunch of duplicates in the tree since some modules have not yet been upgraded.

Solution(s)

In the short term, to fix the problem:

  1. we will expedite those upgrades and ensure everything is the latest.
  2. I will look for every opportunity to remove deps with code that can be easily inlined

After that:

  1. we are upgrading to es6 everywhere, which will also eliminate a few deps
  2. I'm considering inlining the parsers/compilers instead of using snapdragon

fwiw, I would never publish code that took 90ms to load! that horrifies me. I'm an optimization freak. This will be fixed asap.

@mrmlnc
Copy link
Owner Author

mrmlnc commented Apr 8, 2018

Hello, @jonschlinkert,

Thanks for quickly response. I answered you in the previously created issue in the micromatch repository. I think we don't need to hurry.

@mrmlnc
Copy link
Owner Author

mrmlnc commented Apr 22, 2019

The original problem is fixed after migration from micromatch@3 to micromatch@4.

#154

The next slowdown problem will be fixed in the issue #156.

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