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

Use :erpc when depending on OTP 23 or higher, otherwise use current implementation #91

Closed
cabol opened this issue Dec 20, 2020 · 2 comments

Comments

@cabol
Copy link
Owner

cabol commented Dec 20, 2020

Use :erpc when depending on OTP 23 or higher, otherwise use the current implementation to key backward compatibility (but it will be deprecated).

After running several benchmark tests, using :erpc the performance was improved almost 3x compared with the current implementation using distributed tasks.

@cabol
Copy link
Owner Author

cabol commented Dec 21, 2020

This also improves the distributed adapters' performance, like Nebulex.Adapters.Partitioned reported in #80.

@cabol
Copy link
Owner Author

cabol commented Dec 23, 2020

Local benchmarks

Benchmarks using benchee

Benchee info

Operating System: macOS
CPU Information: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Number of Available Cores: 16
Available memory: 16 GB
Elixir 1.11.2
Erlang 23.1

Benchmark suite executing with the following configuration:
warmup: 2 s
time: 30 s
memory time: 0 ns
parallel: 4
inputs: rand
Estimated total run time: 8 min

Partitioned Adapter with current implementation (Distributed tasks)

Name               ips        average  deviation         median         99th %
get             7.01 K      142.55 μs    ±66.68%         185 μs         321 μs
ttl             6.88 K      145.34 μs    ±66.56%         190 μs         320 μs
has_key?        6.81 K      146.84 μs    ±67.16%         190 μs      339.65 μs
put             6.73 K      148.61 μs    ±66.52%         192 μs         338 μs
put_new         6.69 K      149.38 μs    ±67.08%         192 μs         360 μs
expire          6.68 K      149.80 μs    ±66.70%         193 μs         340 μs
delete          6.61 K      151.37 μs    ±67.35%         195 μs         354 μs
take            6.60 K      151.63 μs    ±67.66%         194 μs         363 μs
replace         6.55 K      152.65 μs    ±66.86%         196 μs         351 μs
incr            4.41 K      226.71 μs    ±23.21%         208 μs         433 μs
get_all         3.57 K      280.44 μs    ±25.43%         260 μs         527 μs
put_all         3.51 K      284.75 μs    ±24.86%         262 μs         506 μs
update          3.38 K      296.15 μs    ±64.92%         385 μs         595 μs
size            2.01 K      498.21 μs    ±17.94%         486 μs         779 μs
all             1.50 K      667.83 μs    ±21.41%         646 μs        1148 μs

Partitioned Adapter using :erpc

Name               ips        average  deviation         median         99th %
get            18.04 K       55.43 μs    ±71.87%       68.98 μs      132.98 μs
has_key?       17.96 K       55.68 μs    ±72.43%       69.98 μs      123.98 μs
delete         17.56 K       56.95 μs    ±72.03%       70.98 μs      138.98 μs
expire         17.48 K       57.20 μs    ±71.75%       70.98 μs      137.98 μs
ttl            17.38 K       57.54 μs    ±72.19%       70.98 μs      138.98 μs
take           17.24 K       58.01 μs    ±71.15%       71.98 μs      148.98 μs
put            17.09 K       58.51 μs    ±69.34%       71.98 μs      141.98 μs
put_new        16.92 K       59.10 μs    ±70.54%       72.98 μs      150.98 μs
replace        16.85 K       59.34 μs    ±70.28%       72.98 μs      153.98 μs
incr           12.18 K       82.13 μs    ±37.97%       73.98 μs      212.98 μs
get_all         9.75 K      102.53 μs    ±28.53%       95.98 μs      210.98 μs
put_all         9.04 K      110.60 μs    ±24.47%      105.98 μs      214.98 μs
update          8.76 K      114.16 μs    ±65.78%      142.98 μs      277.98 μs
size            4.26 K      234.82 μs    ±18.88%      227.98 μs      378.98 μs
all             2.55 K      392.22 μs    ±20.51%      380.98 μs      693.98 μs

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

1 participant