Identical on ints is worse than equals on ints #56829
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
P3
A lower priority bug or feature request
triaged
Issue has been triaged by sub team
type-performance
Issue relates to performance or code size
Using
==
on two ints I get code like this:(from
StringTokenImpl.isIdentifier
with@pragma("vm:never-inline")
on it).While I don't understand the 0x80 vs 0x78 and
mov %rbp,%rsp
andpop %rbp
part, it loads the field, compares it to 0x61 (97 aka$a
akaIDENTIFIER_TOKEN
in the dart code) and returns.Using
identical
instead I get this:where it has added boxing into the mix, doubling the int to box it, checking (I think) if it is now so big it should do other stuff, then comparing to 0xc2 (aka
194
aka boxed97
).Changing the scanner/parser from using identical to using == (23f0c0b) improved the runtime of the CFE compiling itself by ~0.5-0.6% --- but maybe the VM could just skip the boxing?
/cc @mraleph
The text was updated successfully, but these errors were encountered: