-
Notifications
You must be signed in to change notification settings - Fork 100
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 a pointer for PC instead of an instruction counter #776
Conversation
fd62240
to
7ba3de2
Compare
7ba3de2
to
7b2678e
Compare
7b2678e
to
1233d4b
Compare
I found out that for some reason this floating point test is way slower: -module(pi).
-export([run/0, pi/4, ok/0]).
ok() ->
ok.
run() ->
pi(4, 3, -1, 1000000).
pi(Value, _N, _Sign, 0) ->
Value;
pi(Value, N, Sign, Iterations) ->
pi(Value + Sign * (4 / N), N + 2, -Sign, Iterations - 1). |
I added the test to atomvm_benchmark in pguyot/atomvm_benchmark#3. However, I don't get your result on macOS with OTP26.
Everything was compiled with OTP26. Which platform and which OTP version did you test it with? |
The results depend on the SDK/gcc versions.
|
On top of #805, this brings a significant speed increase (38%) to pi_test benchmark on ESP32 with sdk 4.4 |
Also mark code in modules as const. Signed-off-by: Paul Guyot <[email protected]>
1233d4b
to
360b979
Compare
Also mark code in modules as const.
This optimization brings an additional 20% speed upgrade to the Sudoku
benchmark.
These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).
SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later