caohaiwd / gperftools

Automatically exported from code.google.com/p/gperftools
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

pprof: IsSymbolizedProfileFile really slow #229

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Because it isn't careful about opening the file to ensure that the first
"line" is actually a line, like ReadProfile is.

This patch fixes it to work like ReadProfile, and thus decreases the time
to start up quite dramatically!

Original issue reported on code.google.com by james.y....@gmail.com on 2 Apr 2010 at 3:52

Attachments:

GoogleCodeExporter commented 9 years ago
It looks like your patch changes the semantics of this function.  Before, it 
would 
return true if *any* line had the symbol-marker in it.  After your change, it 
would 
only return true if the first line has the marker in it.  However, I think the 
old 
code was unnecessarily permissive, and your changed semantics are fine.

Looking at code around this patch, I see some duplicated code (which you're now 
duplicating a third time), which could afford to be cleaned up.  So I've 
refactored a 
bit to solve this problem another way, but that gets the same result.  It 
should be 
in the next release.

Original comment by csilv...@gmail.com on 5 Apr 2010 at 6:46

GoogleCodeExporter commented 9 years ago

Original comment by csilv...@gmail.com on 6 Apr 2010 at 5:32

GoogleCodeExporter commented 9 years ago
This should be fixed in perftools 1.6, just released.

Original comment by csilv...@gmail.com on 5 Aug 2010 at 8:50