Wednesday, December 30, 2020

Speed test of various dart outputs

Recently, I was playing around with dart and got to know that it supports output of various types. So curiosity arises that which one would be fastest.

So to find out that I used basic hello-world sample

After that, I wrote the bash script

Test Result

On execution of this shell script, I got this

% sh


Hello, World!

real 0m0.285s

user 0m0.283s

sys 0m0.077s


Hello, World!

real 0m0.119s

user 0m0.138s

sys 0m0.027s


Generated: /.../test.exe

Hello, World!

real 0m0.118s

user 0m0.007s

sys 0m0.014s


Generated: /.../test.aot

Hello, World!

real 0m0.019s

user 0m0.007s

sys 0m0.009s


Then accumulated these data to process it as a chart that shows the speed test result

  • Raw refers to the raw source-code
  • Snapshot refers to the platform independent intermediary code
  • Executable refers to the platform dependent native executable file
  • Aot refers to the AOT file for VM


The speed in descending order would be like this,

AOT > Executable > Snapshot > Raw

So the execution speed of AOT is fastest whereas Raw is slowest.

No comments:

Post a Comment