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

poor performance under profiling [rt.cpan.org #67858] #6

Open
dagolden opened this issue Mar 27, 2013 · 0 comments
Open

poor performance under profiling [rt.cpan.org #67858] #6

dagolden opened this issue Mar 27, 2013 · 0 comments

Comments

@dagolden
Copy link
Collaborator

https://rt.cpan.org/Ticket/Display.html?id=67858

I've been using Capture::Tiny lately to great effect, but recently came 
across a problem in conjunction with Devel::NYTProf. Perhaps you've 
already encountered this, but when run under profiling Capture::Tiny 
spends a great deal of time in C<_files_exist()>.

A simple demonstration would be:

> perl -d:NYTProf -MCapture::Tiny=tee_merged -le 'tee_merged { print 
"hi" } for 1 .. 100' > /dev/null
> nytprofcsv Generating CSV report...
Reading nytprof.out
Processing nytprof.out data
Writing sub reports to nytprof directory
 100% ...
Writing block reports to nytprof directory
 100% ...
Writing line reports to nytprof directory
 100% ...
> grep 'sub _files_exist' nytprof/Capture-Tiny-pm-2-sub.csv 
2.537151,196944,0.000013,sub _files_exist { -f $_ || return 0 for @_; 
return 1 }

That grep result shows that C<_files_exist()> was called almost 200,000 
times and took about 2.5 seconds. This adds noise to the profile output, 
and makes certain profiling tasks take an enormous amount of time.

When run without NYTProf, performance is fine, so it seems to be based 
on interference. I'm not sure if you can alter this behavior, but wanted 
to bring it to your attention.

Thanks for the module!

 - danboo
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

0 participants