On Wed, Aug 04, 2004 at 11:04:12PM +1000, Peter Moulder wrote:
On Tue, Aug 03, 2004 at 09:03:12AM -0300, bulia byak wrote:
Simply by timing loading/quitting with a big file (tutorial-basic now loads in 2.59 sec averaged). But these two [] operators are on top of the profile no matter what you do,
This seems suspicious to me: if they have an item in the profile, then that suggests that they aren't getting inlined.
Offhand, I'd have expected that the test can be optimized away if the function is inlined, but of course there's no way of optimizing it away if it isn't inlined.
What compilation flags are you using? What compiler?
With g++-3.3 -O2 -pg -g2, adding `g_assert( i < 2 )' makes the function appear in the profile, presumably meaning it isn't inlined.
That's disappointing (and surprising). Could it be due to variadic g_log?
*compile*
Yes, changing it to `if ( i >= 2 ) abort();' makes it disappear from the profile again, and the times are indistinguishable from without having the check.
That's quite disturbing. That suggests that g_assert should be changed: currently it calls g_log with 7 arguments, which could easily be trimmed (though with trade-offs involved).
pjrm.