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

Non linear start-up time for large folders #222

Open
chebum opened this issue Jun 28, 2016 · 3 comments
Open

Non linear start-up time for large folders #222

chebum opened this issue Jun 28, 2016 · 3 comments

Comments

@chebum
Copy link

chebum commented Jun 28, 2016

Hi,

startup.js test suite on my machine shows that startup time increases non-linearly. For 100 items per folder it's 1.5ms per file, while for 1000 items it's 7ms per file. I found two problems helper.objectPush method.

  1. When adding an array of items, the method does concatenation and allocates new array. Then again a new array is allocated inside the helper.unique method.
  2. Calling helper.unique method isn't necessary when adding a single item into the array. It's enough to call indexOf to check that the val doesn't exist in the current array.

Changes above greatly improves performance on my machine. Actually per file time reduces with growing number of files per directory.

I'll submit a PR in a minute. If the suggestions above make sense, please accept it.

Thanks,

@chebum
Copy link
Author

chebum commented Jul 12, 2016

As long as this repo seems to be abandoned, take a look at this fork: https://github.com/chebum/gaze It contains a fix and use instructions.

@shama
Copy link
Owner

shama commented Aug 3, 2016

If you want to send a PR for it, the patch looks good to me. Thanks!

@chebum
Copy link
Author

chebum commented Aug 4, 2016

@shama My fix conflicts with a test mentioned in #214. I believe the test is wrong. Could you please check if I'm correct or not?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants