Comments (4)
Blackfire suggests that the ExcludeDirectoryFilterIterator
might be the culprit here.
I created a simple test script based on your example: https://gist.github.com/colinodell/d6fd7a4cb6d9fbf8aa20154755278385
I ran this script with 50 iterations and again with 200 - a 300% increase. I expected to see a corresponding 300% increase in CPU usage; however, I saw a 466% increase (1.65 seconds to 9.31 seconds):
This iterator is used to exclude certain files; by default, the Finder
will exclude dotfiles and VCS files. On a hunch, I added these two calls to the Finder
configuration:
->ignoreDotFiles(false)
->ignoreVCS(false)
I then re-profiled and got these results which matched the ~300% increase I expected:
CPU time went from 887ms to 3.35 seconds.
from resource-watcher.
@colinodell Thank you so much for the your input here. I added
->ignoreDotFiles(false)
->ignoreVCS(false)
and the problem seems to have been solved now. So I'm very happy with the suggestion you made.
Something I don't understand well yet is why the cpu kept growing. I'd assume that without the added code the cpu usage should have stayed on the same level. Do you know why the cpu was growing on each iteration?
from resource-watcher.
I'm not really sure why it kept growing.
Time spent in the constructor grew by 10x:
According to Blackfire, most of that extra time came from the constructor itself, not other function calls:
Perhaps there's something going on at the language/interpreter level? Maybe extra garbage collection, memory allocation, or something like that? (I don't know - that's beyond my knowledge)
I also saw a bunch of time spent rewinding iterators - not sure if that's also related or not.
from resource-watcher.
Thanks for the response @colinodell
from resource-watcher.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from resource-watcher.