dart-sdk/benchmarks
Stephen Adams 6ca7571e2b [benchmark] Benchmark for switch on various constant types
AOT:
SwitchFSM.enum(RunTime): 29.549523327947906 us.
SwitchFSM.int(RunTime): 37.73789702628717 us.
SwitchFSM.class(RunTime): 138.6418530572675 us.
SwitchFSM.string(RunTime): 797.54075 us.

dart2js+V8:
SwitchFSM.enum(RunTime): 31.484299349840917 us.
SwitchFSM.int(RunTime): 26.022895908416366 us.
SwitchFSM.class(RunTime): 91.67433302667894 us.
SwitchFSM.string(RunTime): 92.31338451577098 us.

Both AOT and dart2js are 'good at' switches on enum values.

When compiled with --enable-experiment=records,patterns:

AOT:
SwitchFSM.enum(RunTime): 141.75470079359405 us.
SwitchFSM.int(RunTime): 145.25322604030737 us.
SwitchFSM.class(RunTime): 138.45460840662005 us.
SwitchFSM.string(RunTime): 797.226 us.

dart2js+V8:
SwitchFSM.enum(RunTime): 98.93787283573403 us.
SwitchFSM.int(RunTime): 29.459852700736498 us.
SwitchFSM.class(RunTime): 98.62184338405162 us.
SwitchFSM.string(RunTime): 92.035889371936 us.

There is work to be done to recover the performance.

Change-Id: I1197129cb32615a06a63a05d7ba300b46c68b4d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/287246
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Stephen Adams <sra@google.com>
2023-03-10 04:21:13 +00:00
..
AsyncLiveVars
BigIntParsePrint
Calls
DartCLIStartup
Dynamic
EventLoopLatencyJson
EventLoopLatencyJson350KB
EventLoopLatencyRegexp
Example
FfiAsTypedList
FfiBoringssl
FfiCall
FfiMemory
FfiStruct
FfiStructCopy
FileIOSink/dart
InstantiateTypeArgs
IntegerSetLookup
Isolate
IsolateBaseOverhead
IsolateFibonacci
IsolateJson
IsolateRegExp/dart
IsolateSendExitLatency
IsolateSpawn
IsolateSpawnMemory
Iterators
ListCopy
LongStringCompare/dart
MapCopy
MapLookup
MD5
MultipleReturns/dart
NativeCall
ObjectHash
Omnibus
OmnibusDeferred
RecordCollections/dart
Richards
RuntimeType
SDKArtifactSizes
SendPort
SHA1
SHA256
SkeletalAnimation
SkeletalAnimationSIMD
SoundSplayTreeSieve
Startup
StringPool
SwitchFSM/dart [benchmark] Benchmark for switch on various constant types 2023-03-10 04:21:13 +00:00
TypedDataDuplicate
TypedDataPoly/dart
TypeLiteral/dart
Utf8Decode
Utf8Encode
analysis_options.yaml
OWNERS