Re: Clear() function excessive CPU usage

2009-03-05 Thread Kenton Varda
On Thu, Mar 5, 2009 at 4:42 PM, Zachary Turner wrote: > I'll try to come up with a sample tomorrow, but the surrounding code is > pretty complex, so I'm not 100% sure it will still exhibit the same pattern > if I do the same thing in a stripped application. > > As an alternative to not clearing th

Re: Clear() function excessive CPU usage

2009-03-05 Thread Zachary Turner
I'll try to come up with a sample tomorrow, but the surrounding code is pretty complex, so I'm not 100% sure it will still exhibit the same pattern if I do the same thing in a stripped application. As an alternative to not clearing the items before I put them back in the list, would there be any p

Re: Clear() function excessive CPU usage

2009-03-05 Thread Kenton Varda
On Thu, Mar 5, 2009 at 4:02 PM, Zachary Turner wrote: > I get somewhat better results with that flag. I built protobuf with > profiling enabled and I'm a little suspicious that the information is 100% > accurate, but it seems like std::string::clear() takes up the most time. > But the percentage

Re: Clear() function excessive CPU usage

2009-03-05 Thread Zachary Turner
I get somewhat better results with that flag. I built protobuf with profiling enabled and I'm a little suspicious that the information is 100% accurate, but it seems like std::string::clear() takes up the most time. But the percentages don't match up to what I calculate, so I'm not sure where the

Re: Clear() function excessive CPU usage

2009-03-05 Thread Kenton Varda
Add this to your .proto file: option optimize_for = SPEED; Does it help? On Thu, Mar 5, 2009 at 3:23 PM, Zachary Turner wrote: > > I'll give it a try. I haven't built the protobuf libraries with > instrumenting support or else I'd already know, but I should be able > to get it working. > > On

Re: Clear() function excessive CPU usage

2009-03-05 Thread Zachary Turner
I'll give it a try. I haven't built the protobuf libraries with instrumenting support or else I'd already know, but I should be able to get it working. On Mar 5, 5:20 pm, Kenton Varda wrote: > Wow, that's interesting.  I don't know why it would do that.  Can you look > deeper into your profiles

Re: Clear() function excessive CPU usage

2009-03-05 Thread Kenton Varda
Wow, that's interesting. I don't know why it would do that. Can you look deeper into your profiles and see what part of Clear() is taking so long? For example, is it spending the time clearing STL strings? On Thu, Mar 5, 2009 at 3:11 PM, Zachary Turner wrote: > > I have a fairly old version of