-
Notifications
You must be signed in to change notification settings - Fork 3
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
Too slow parallel execution with :crypto.strong_rand_bytes/1
#41
Comments
Thank you for the report. Maybe openssl version but more likely openssl build flags we use are the culprit?
You can make a build locally like this:
If you can reproduce slowness and/or performance improvements by changing build script we'd happily accept a PR. |
Thank you for your information. I tested the script without any modification, but I got the error: In file included from sys/unix/erl_unix_sys.h:65:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:525:10: fatal error: cannot open file 'aarch64-apple-darwin/opt/jit/_ctermid.h': Too many open files
525 | #include <_ctermid.h>
| ^
CXX obj/aarch64-apple-darwin/opt/jit/instr_map.o
1 error generated.
make[4]: *** [obj/aarch64-apple-darwin/opt/jit/beam_asm_module.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [opt] Error 2
make[2]: *** [opt] Error 2
make[1]: *** [jit] Error 2
make: *** [emulator] Error 2 Fortunately, I know how to fix the issue: ulimit -n 65536 Then, I got the executable at the following path: tmp/otp_builds/otp-OTP-27.1.2-openssl-3.1.6-wxwidgets-3.2.6/bin/erl Then, I tested the benchmark with the generated Operating System: macOS
CPU Information: Apple M3 Max
Number of Available Cores: 16
Available memory: 128 GB
Elixir 1.17.3
Erlang 27.1.2
JIT enabled: true
Benchmark suite executing with the following configuration:
warmup: 2 s
time: 5 s
memory time: 0 ns
reduction time: 0 ns
parallel: 1
inputs: none specified
Estimated total run time: 14 s
Benchmarking parallel execution ...
Benchmarking sequential execution ...
Calculating statistics...
Formatting results...
Name ips average deviation median 99th %
sequential execution 0.33 3.06 s ±1.42% 3.06 s 3.09 s
parallel execution 0.22 4.57 s ±5.25% 4.57 s 4.74 s
Comparison:
sequential execution 0.33
parallel execution 0.22 - 1.49x slower +1.51 s This is the expected results, so no problem. I continue to try to fix this issue. Thank you. |
I tested the settings of Homebrew openssl@3, but the benchmark score did not improve. |
Could you try statically linking to OpenSSL you got from homebrew? That should rule out OpenSSL build options differences hopefully. If that does not improve performance is it possible it is the difference between static and dynamic linking? |
OK, I'll try later. |
Hi,
I tested the following benchmark on M3 Max:
The log of the execution with Erlang/OTP installed by
asdf
is as follows:However, the log of the execution with the community-maintained pre-compiled Erlang/OTP for macOS is as follows:
It seems too slow parallel execution of this benchmark. I felt this is an issue.
The text was updated successfully, but these errors were encountered: