Skip to content
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

Pickle is fast for some cases #8

Open
monkwooo opened this issue Aug 23, 2017 · 1 comment
Open

Pickle is fast for some cases #8

monkwooo opened this issue Aug 23, 2017 · 1 comment

Comments

@monkwooo
Copy link

try this and see the output.
Would appreciate if you can explain me why test case in attached file shows pickle is faster while json is slower. [I do not understand what is happening here]. I merely stumbled onto this test case because of the use case in my project.

test.txt

@dlukes
Copy link

dlukes commented Jun 30, 2020

Pickle got faster than JSON over the years -- I updated the benchmark from the article for Python 3 and under Python 3.8, pickle runs faster. See https://github.com/dlukes/pickle-json-benchmark.

Another thing is that your benchmark may not be very robust, you should probably do multiple runs and average them :) Have a look at https://docs.python.org/3.8/library/timeit.html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants