Giter VIP home page Giter VIP logo

Comments (4)

colinodell avatar colinodell commented on August 18, 2024

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):

image

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:

image

CPU time went from 887ms to 3.35 seconds.

from resource-watcher.

freekmurze avatar freekmurze commented on August 18, 2024

@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.

colinodell avatar colinodell commented on August 18, 2024

I'm not really sure why it kept growing.

Time spent in the constructor grew by 10x:

image

According to Blackfire, most of that extra time came from the constructor itself, not other function calls:

image

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.

yosymfony avatar yosymfony commented on August 18, 2024

Thanks for the response @colinodell

from resource-watcher.

Related Issues (5)

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.