db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Optimization of switch statements?
Date Wed, 19 Nov 2008 15:05:41 GMT
Hello,

While looking through some code related to data types, I came across a 
few switch statements. I know these used to be optimized "in the old 
times", typically in two ways:
 o Keep the values close to each other (to enable use of a direct lookup 
table).
 o Put the most frequently seen values up front.

Does anyone know if such optimizations still have any meaning?
Or are the hotspot optimizers smart enough to do something about this now?

This question is more about curiosity than hope of any significant 
speed-ups :)
And no, I haven't written a micro benchmark for this...


-- 
Kristian

Mime
View raw message