Change autogenerated switchcase converter for all enums
to calculated converter Currently, converter for enum generate a list of switch case statements. This is inefficient so we generate the conversion with mathematical op to reduce the amount of switch case statement because more switch case statement means longer runtime and larger binary size. Gen diff: https://gist.github.com/nguyen-minh-duc/166720ffe3821202093ef00ea83dd028/revisions The graph represent the runtime of the switch case function (blue line) and the matops function (orange line). As we can see as the number of of case statement increase the runtime increase linearly but the matops function is constant. So changing the switch case statement into math operation does generate a gain in runtime. Graph: https://drive.google.com/a/google.com/file/d/0B-Uw1D6S_sSVN1FwUFVoaXA5NEk/view?usp=sharing Bug: Change-Id: I4a68dd5e7f35c4879a75245b87409b44b11f1e78 Reviewed-on: https://chromium-review.googlesource.com/564903 Commit-Queue: Minh-Duc Nguyen <nmduc@google.com> Reviewed-by:Darren Shen <shend@chromium.org> Reviewed-by:
nainar <nainar@chromium.org> Reviewed-by:
meade_UTC10 <meade@chromium.org> Cr-Commit-Position: refs/heads/master@{#486550}
Showing
Please register or sign in to comment