This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c/7344: performance regression on huge case statements


On Thursday, October 10, 2002, at 10:13  PM, Nathanael Nerode wrote:

Daniel Berlin wrote:

It doesn't cache the info (I think Jan said he could make it constant time
in the alternative, which would also solve the problem), so it is
constantly recomputing a value that hasn't changed.
(...and one which is expensive to compute using the current algorithm)

This is the ironic part: It's not that expensive to compute.
It's O(log n)
It just used to be O(1), so it's 1-15 times slower than it used to be.

You wouldn't notice in most cases, because it scales so slowly.
In fact, I only cached it because on the tree-ssa-branch, because there were cases where it was called 238 million times.
You start to notice at that point :).


--Dan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]