We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
while
l_nth
The while with l_nth pattern is often used in the interpreter.
However, in my experimental evaluation:
function main() { // List with 10000 integer elements lst := [0, 1, ..., 9999] n := l_len(lst); i := 0; while (i < n) { v := l_nth(lst, i); print v; i := i + 1; } return 0; }
function main() { // List with 10000 integer elements lst := [0, 1, ..., 9999] res := 0; foreach (v : lst) { res := res + v; } return 0; }
is:
hyperfine "ecma-sl interpret while.esl" "ecma-sl interpret foreach.esl" Benchmark 1: ecma-sl interpret while.esl Time (mean ± σ): 126.3 ms ± 3.4 ms [User: 113.0 ms, System: 13.3 ms] Range (min … max): 121.3 ms … 134.6 ms 23 runs Benchmark 2: ecma-sl interpret foreach.esl Time (mean ± σ): 47.9 ms ± 2.2 ms [User: 34.9 ms, System: 12.9 ms] Range (min … max): 45.6 ms … 57.3 ms 64 runs Summary ecma-sl interpret foreach.esl ran 2.64 ± 0.14 times faster than ecma-sl interpret while.esl
The text was updated successfully, but these errors were encountered:
foreach
array
list
Successfully merging a pull request may close this issue.
The
while
withl_nth
pattern is often used in the interpreter.However, in my experimental evaluation:
is:
The text was updated successfully, but these errors were encountered: