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

Compare RISC-V/Swift to Custom ISA/Go #3697

Open
Tracked by #3692
j1010001 opened this issue Nov 26, 2024 · 3 comments
Open
Tracked by #3692

Compare RISC-V/Swift to Custom ISA/Go #3697

j1010001 opened this issue Nov 26, 2024 · 3 comments

Comments

@j1010001
Copy link
Member

No description provided.

@jsproz
Copy link

jsproz commented Dec 3, 2024

The attached archive has the C++, RISC-V assembly, and hexdump of the imperative and recursive fibonacci functions. The assembly and hex files were created with the cadence-tool. The hex files can be executed using the cadence-tool. The imperative version is 10x faster than the recursive version. Currently the recursive version does not work for values greater than 9.

fibonacci.zip

@SupunS
Copy link
Member

SupunS commented Dec 3, 2024

These are the numbers (execution time) for the custom VM/ISA:

Implementation fib(9) fib(14) fib(46)
Imperative 0.745Β΅ 1.239Β΅ 5.260Β΅
Recursive 7.220Β΅ 80.67Β΅ 392.31s

(Runtime checks were disabled)

Benchmarked on my laptop: Apple M1 Pro, 8-Cores, 16GB RAM

Source code: vm_bench_test.go

@SupunS
Copy link
Member

SupunS commented Dec 13, 2024

Fib(46) comparison:

                β”‚  fib_riscv  β”‚             fib_vm                   β”‚
                β”‚   sec/op    β”‚    sec/op     vs base                β”‚
FibImperative-8   718.6n Β± 2%   3232.0n Β± 1%  +349.73% (p=0.002 n=6)

                β”‚ fib_riscv β”‚         fib_vm              β”‚
                β”‚   B/op    β”‚    B/op     vs base         β”‚
FibImperative-8    0.0 Β± 0%   264.0 Β± 0%  ? (p=0.002 n=6)

                β”‚ fib_riscv β”‚         fib_vm              β”‚
                β”‚ allocs/op β”‚ allocs/op   vs base         β”‚
FibImperative-8   0.00 Β± 0%   33.00 Β± 0%  ? (p=0.002 n=6)

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

No branches or pull requests

4 participants