(Slightly) Improve Python and Cython benchmarks#25
Open
althonos wants to merge 3 commits intosamuell:masterfrom
Open
(Slightly) Improve Python and Cython benchmarks#25althonos wants to merge 3 commits intosamuell:masterfrom
althonos wants to merge 3 commits intosamuell:masterfrom
Conversation
Owner
|
Cool, thanks @althonos ! Sorry, have been too buried in work for a long time, to properly maintain the repo... having a look soon! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi there !
It's a very nice project you have, I'm usually too lazy to setup a proper environment for benchmarking but with yours ready I could just pop in some extra benches without trouble.
As a Pythonista, I am aware of Python's abysmal performances regarding I/O, but I was still a bit sad to see it so low in the list. I also looked at the Cython solution and saw that it was clearly not using the whole power of Cython, so here's what I added:
python.001.binaryandpypy.001.binary: exactly the same logic as thepythonandpypybenches, except that the files are opened in binary mode, which should save a bit of time decoding. It doesn't seem to make any difference with PyPy, but it does improve CPython a bit.cython.001.fopen: a Cython version that actually uses the code fromc.001in Cython syntax, it runs as fast asc.001.I didn't bench against everything else because I was missing some of the other languages compilers, but here is what I get on my machine (idle Intel NUC with i7-10710U CPU @ 1.10GHz, no particular BIOS setting):
I'll see if i can find other solutions with Python that make it look a little better, but I don't have any high hopes 😅
Cheers!