tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 56582] Use switch(enum) in implementations of ActionHook.action(ActionCode, ...)
Date Thu, 05 Jun 2014 00:56:19 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=56582

--- Comment #4 from Christopher Schultz <chris@christopherschultz.net> ---
(In reply to Konstantin Kolinko from comment #1)
> I plan to backport this change to Tomcat 7, as I think switch() behaves
> better for performance.

+1

A tableswitch will be faster than a series of comparisons and jumps. If the set
of cases is sufficiently sparse, it will degrade to a lookupswitch which is no
slower than the old if/elseif implementation and may be a bit faster as
lookupswitch is likely to be a highly-optimized JVM operation not requiring any
JIT trickery.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message