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

update rustler to 0.24 #25

Merged
merged 2 commits into from
Feb 24, 2022
Merged

Conversation

ayrat555
Copy link
Contributor

use NewBinary instead of OwnedBinary (https://github.com/rusterlium/rustler/blob/master/CHANGELOG.md#0240---2021-02-24)

I did some benchmarks

with NewBinary

Operating System: macOS
CPU Information: Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Number of Available Cores: 8
Available memory: 16 GB
Elixir 1.12.1
Erlang 24.0.1

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 1.67 min
memory time: 1.67 min
parallel: 4
inputs: none specified
Estimated total run time: 3.37 min

Benchmarking ex_keccak...

Name                ips        average  deviation         median         99th %
ex_keccak       61.15 K       16.35 μs   ±568.01%          11 μs          44 μs

Memory usage statistics:

Name         Memory usage
ex_keccak            48 B

with OwnedBinary

Operating System: macOS
CPU Information: Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
Number of Available Cores: 8
Available memory: 16 GB
Elixir 1.12.1
Erlang 24.0.1

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 1.67 min
memory time: 1.67 min
parallel: 4
inputs: none specified
Estimated total run time: 3.37 min

Benchmarking ex_keccak...

Name                ips        average  deviation         median         99th %
ex_keccak       51.55 K       19.40 μs   ±650.83%          20 μs          54 μs

Memory usage statistics:

Name         Memory usage
ex_keccak            96 B

it seems with NewBinary the library performs better both in terms of memory and ips

@tzumby
Copy link
Collaborator

tzumby commented Feb 24, 2022

Awesome, thanks @ayrat555!

@tzumby tzumby merged commit 02cdda8 into ExWeb3:master Feb 24, 2022
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.

2 participants