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
lists:reverse/1
lists:reverse/2
Describe the bug
lists:reverse(List,[]) is ~50% faster than lists:reverse(List) for big lists, and about the same for tiny lists, according to my benchmarks.
lists:reverse(List,[])
lists:reverse(List)
Unlike lists:reverse/1, lists:reverse/2 is implemented in a BIF, and is documented as follows:
Returns a list with the elements in List1 in reverse order, with tail Tail appended. Example: $ lists:reverse([1, 2, 3, 4], [a, b, c]). [4,3,2,1,a,b,c]
Returns a list with the elements in List1 in reverse order, with tail Tail appended.
Example:
$ lists:reverse([1, 2, 3, 4], [a, b, c]). [4,3,2,1,a,b,c]
Expected behaviour Comparable performance between the two.
The text was updated successfully, but these errors were encountered:
Hmm, after rerunning my benchmarks with more samples, I can't reproduce this, so I guess it was just noise.
Sorry, something went wrong.
No branches or pull requests
Describe the bug
lists:reverse(List,[])
is ~50% faster thanlists:reverse(List)
for big lists, and about the same for tiny lists, according to my benchmarks.Unlike
lists:reverse/1
,lists:reverse/2
is implemented in a BIF, and is documented as follows:Expected behaviour
Comparable performance between the two.
The text was updated successfully, but these errors were encountered: