ParserBase could be optimized #92088
Labels
3.13
new features, bugs and security fixes
performance
Performance or resource usage
stdlib
Python modules in the Lib dir
type-feature
A feature request or enhancement
There is a lot of wasteful CPU code in this fashion (seen multiple times) :-
search performed in string twice, even if we could just do it once.
Consider the strings immutable, then on every slice a new string is created on the fly.
Moreover, the slicing done at
rawdata[j:]
, is bound to be quite expensive depending on the size of the string.We could eliminate slicing altogether and only have one find operation in this style :-
I'm new to Open Source Code Contributions. Would love to learn from other's coding style & know other's point of view.
Originally posted by @be-thomas in #92084 (comment)
The text was updated successfully, but these errors were encountered: