Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development
modifications on the profiler plugin (cosmethical)
oBFusCATed:
Without seeing the code you could try:
--- Code: ---
for(int i = ....)
{
... work ....
if(i % 100 == 0)
progress->update();
}
progress->update();
--- End code ---
MortenMacFly:
--- Quote from: nausea on October 08, 2009, 08:28:34 pm ---well, good catch, I feel a little bit dump having commite exactly that stupid error.
--- End quote ---
Don't worry. Devs make mistakes... all the time, all the day. ;-)
--- Quote from: nausea on October 08, 2009, 08:28:34 pm ---If I comment out all the updating of that wxProgressDialog, the plugin parses my project in about one second. Whith the wxProgressDialog as is it takes about 10 seconds.
--- End quote ---
Ok - I got the point. So... if I use i % 10 then it should be called 1/10 times, which should lead to the same ratio.
--- Quote from: nausea on October 08, 2009, 08:28:34 pm ---but I seem to remember that gcc does not produce any basic-block profiling information when profiling ...
--- End quote ---
Might be true for GCC/MinGW. But probably other GCC variants (Win, Linux, ARM, PPC, whatever...) do different. C::B supports GCC variants quite easily. And with every GCC comes a gprof usually. So we better leave that option. ;-)
--- Quote from: nausea on October 08, 2009, 08:28:34 pm ---What do you say of the rest of my changes ?
--- End quote ---
They are fine with me. I am testing them and all seems to work fine. I'll probably commit the modified variant later (not today anymore).
frithjofh:
Hi Morten,
I looked through your changes ... shouldn't it be
--- Code: ---i % 10 == 0
--- End code ---
to achieve 1/10 times update? If you only check against
--- Code: ---i % 10
--- End code ---
I think it's nine times update and one time skip ...
Regards
nausea
MortenMacFly:
--- Quote from: nausea on October 13, 2009, 01:33:39 pm ---
--- Code: ---i % 10 == 0
--- End code ---
to achieve 1/10 times update? If you only check against
--- End quote ---
...erm... yes?! :lol: :oops:
Navigation
[0] Message Index
[*] Previous page
Go to full version