Re: Switch statement optimization

2022-04-19 Thread Martin Liška
On 4/18/22 16:41, Paul Koning via Gcc wrote: In switch statements with dense case values, the typical result is a jump table, which is fast. If the values are sparse, a tree of compares is generated instead. What if nearly all cases are dense but there are a few outliers? An example appears

Re: Switch statement optimization

2006-07-11 Thread Christian Hildner
Joern RENNECKE schrieb: In http://gcc.gnu.org/ml/gcc/2006-07/msg00156.html, your wrote: We could use a cheap hash and base start compare / branch trees in every hash bin. Say we have a 16 k range, 200 nodes, and want to keep the hash bin/node ratio between 2 and 4. Let i be the switch argume

Re: Switch statement optimization

2006-07-10 Thread Joern RENNECKE
In http://gcc.gnu.org/ml/gcc/2006-07/msg00156.html, your wrote: A paper at this year's GCC Summit talked about this: http://www.gccsummit.org/2006/view_abstract.php?content_key=18 You might like to follow up with Edmar (the author of the paper). But that was about optimizing the trees for an

Re: Switch statement optimization

2006-07-10 Thread Ben Elliston
A paper at this year's GCC Summit talked about this: http://www.gccsummit.org/2006/view_abstract.php?content_key=18 You might like to follow up with Edmar (the author of the paper). Cheers, Ben