| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
CC @vstinner I suspect that major slowdown for marshal.loads() benchmarks is due to normalization&singletonization in the PyLongWriter_Finish(). In case of marshal.dumps() I suspect things were better without the value field. |
Sorry, something went wrong.
Co-authored-by: Victor Stinner <vstinner@python.org>
There was a problem hiding this comment.
LGTM. I'm (just) a bit unfortunate that the using PEP 757 makes the code slower.
@serhiy-storchaka @picnixz: Would you mind to review this change?
Sorry, something went wrong.
Sorry, something went wrong.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
There was a problem hiding this comment.
A couple of assertions to add and we're good I think. The most important assertion is assert(layout->bits_per_digit >= PyLong_MARSHAL_SHIFT); because marshal_ratio is 0 otherwise.
Sorry, something went wrong.
There was a problem hiding this comment.
I would still appreciate an assert on any T that does digits[T - 1] for those who only read the macros (or for reviewers) even though you're asserting that at the caller site. The assertions cost nothing and it's semantically better to have assertions verified once you've called the function before calling it (for debugging it's easier to put them before the call so that you know which caller was the bad caller, however I think that assertions should be logically placed in the callee; thus I would put them at both places).
Now, I won't block on this nitpick since it's a matter of taste.
Sorry, something went wrong.
Of course, assert's costs nothing, but I doubt we need this redundancy. Macros code not too big to see obvious assumptions on n/size arguments. So, I'll add suggestions and postpone decision to other reviewers. |
Sorry, something went wrong.
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
@skirpichev: Can you just add assert(size >= 1);? I don't want to apply your suggestion because of a missing space: size>= 1. |
Sorry, something went wrong.
While the code is obvious to you, assertions can help reviewers, who are not used to the code, to understand it. It's not only to check for correctness at runtime. |
Sorry, something went wrong.
Done. Feel free just to edit my pr/suggestions in similar cases.
Well, just the next "for" line, IMO, revival code assumptions for most code readers. |
Sorry, something went wrong.
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
|
Merged. Congrats @skirpichev, this one was tricky :-) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Benchmark hidden because not significant (1): dumps 1<<7