On Mon, Apr 23, 2018 at 5:18 PM David Lloyd <david.ll...@redhat.com> wrote:

> FWIW I strongly doubt this will improve performance; probably the
> opposite in fact, as IIRC an enum switch generates an extra class
> (though perhaps this has changed).  The original code was quite
> compact and utilized identity comparisons, and given there are only
> three alternatives it probably was able to exploit branch prediction
> as well (if such a thing even matters in this context).


Well, there are enum switches on the same enum elsewhere in the class, so
should those instead be replaced by if checks? A larger change could remove
this branch entirely, with different classes for each of the types, which
are known during compile.

Reply via email to