| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Co-authored-by: Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
There was a problem hiding this comment.
@skirpichev Could you also add a test case for Fraction('232e\t2') (this should fail). One optimization I tried passes all the tests, but fails on this one.
Tests pass, and all paths in the new code are needed, so approving. The new code is not very easy to read, but neither is the regular expression that is currently in main.
Sorry, something went wrong.
Done.
I think that the later is more clear. Also, it has more nice tracebacks. So, I'm still not sure about this. Speed gain is x2 at most. Maybe regexps can be eventually optimized? |
Sorry, something went wrong.
|
I was surprised that manual parsing is faster than a regexp-based approach. The regular expression is not optimal, so I tried to optimize it, but the benefit was minuscule. The regexp engine needs to be optimized. Can we please wait a few months with these changes while I try to optimize the regexp engine for such case? This seems so typical that a lot of code would benefit from optimization. |
Sorry, something went wrong.
But not too much.
Sure. I'm not familiar with the regexp module code and I would be interested in such fix, if it's possible at all. BTW, so far this pr was not approved by core dev. @serhiy-storchaka, but what about other change, i.e. moving down numbers.Rational check? Maybe I should factor out this to a separate pr? See benchmarks (third column) and my arguments for this. |
Sorry, something went wrong.
|
Ok, now this has only optimization for str inputs. Other goes to #134320 |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
Documentation build overview482 files changed · ± 446 modified · - 36 deleted ± Modified
- Deleted |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
For reviewers. I'm not sure if it worth (code seems more complex, IMO), but speedup for string parsing seems noticeable (1.3-1.5x).