Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Adding asmjit example #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tsafin
Copy link

@tsafin tsafin commented Nov 10, 2024

  • Also update mir and gnu lightning examples.

* Also update mir and gnu lightning examples.
@tsafin
Copy link
Author

tsafin commented Nov 10, 2024

asmjit is the fastest (checking this under wsl2):

02:27 $ make bench
hyperfine -i -N --warmup 3 \
        './libjit/fib' \
        './libgccjit/toyvm ./libgccjit/fibonacci.toy 42' \
        './mir/fib' \
        './gnu_lightning/fib' \
        './asmjit/fib' \
        './myjit/fib' \
        './gcc/fib' \
        './nasm/fib'
Benchmark 1: ./libjit/fib
  Time (mean ± σ):      1.632 s ±  0.020 s    [User: 1.630 s, System: 0.002 s]
  Range (min … max):    1.614 s …  1.677 s    10 runs
 
Benchmark 2: ./libgccjit/toyvm ./libgccjit/fibonacci.toy 42
  Time (mean ± σ):     715.3 ms ±  34.3 ms    [User: 666.2 ms, System: 6.8 ms]
  Range (min … max):   688.5 ms … 794.4 ms    10 runs
 
Benchmark 3: ./mir/fib
  Time (mean ± σ):     869.8 ms ±  16.6 ms    [User: 867.9 ms, System: 0.0 ms]
  Range (min … max):   844.5 ms … 907.4 ms    10 runs
 
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
 
Benchmark 4: ./gnu_lightning/fib
  Time (mean ± σ):      1.086 s ±  0.091 s    [User: 1.085 s, System: 0.000 s]
  Range (min … max):    1.004 s …  1.310 s    10 runs
 
Benchmark 5: ./asmjit/fib
  Time (mean ± σ):     658.0 ms ±  71.5 ms    [User: 656.8 ms, System: 1.0 ms]
  Range (min … max):   615.6 ms … 848.6 ms    10 runs
 
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
 
Benchmark 6: ./myjit/fib
  Time (mean ± σ):      1.563 s ±  0.057 s    [User: 1.562 s, System: 0.000 s]
  Range (min … max):    1.477 s …  1.631 s    10 runs
 
Benchmark 7: ./gcc/fib
  Time (mean ± σ):     674.4 ms ±  35.9 ms    [User: 672.7 ms, System: 1.0 ms]
  Range (min … max):   645.6 ms … 762.6 ms    10 runs
 
Benchmark 8: ./nasm/fib
  Time (mean ± σ):     806.9 ms ±  17.8 ms    [User: 805.6 ms, System: 0.0 ms]
  Range (min … max):   786.9 ms … 832.4 ms    10 runs
 
Summary
  ./asmjit/fib ran
    1.02 ± 0.12 times faster than ./gcc/fib
    1.09 ± 0.13 times faster than ./libgccjit/toyvm ./libgccjit/fibonacci.toy 42
    1.23 ± 0.14 times faster than ./nasm/fib
    1.32 ± 0.15 times faster than ./mir/fib
    1.65 ± 0.23 times faster than ./gnu_lightning/fib
    2.38 ± 0.27 times faster than ./myjit/fib
    2.48 ± 0.27 times faster than ./libjit/fib
✔ ~/jit/jitverse [asmjit_example L|✚ 1…1] 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant