pxml/autoxml: Replace hacky regex parsing with a list comprehension#235
Open
joebonrichie wants to merge 1 commit intomainfrom
Open
pxml/autoxml: Replace hacky regex parsing with a list comprehension#235joebonrichie wants to merge 1 commit intomainfrom
joebonrichie wants to merge 1 commit intomainfrom
Conversation
4b530a6 to
e22195f
Compare
It's a bit hard to slouth why this code was added, however, it appears to be to ensure the source code order of the keys was respected. With PEP 520, this should no longer be an issue, as it ensures class namespace ordering since Python 3.7. Additionally, previously, some python source code garbage was finding it's way in the variable, e.g. Before: ``` ['t_Distribution', 't_Specs', 't_Packages', '#', 't_Components', 't_Groups', 'if', 'obsoletes_list', 'obsoletes_list', 'latest_packages', 'for', 'if', 'latest_packages.append((pkg,', 'if', 'self.packages'] ``` Now ``` ['t_Distribution', 't_Specs', 't_Packages', 't_Components', 't_Groups'] ``` This also provides a nice speedup throughout the codebase, in one case providing up to a 1.42x speedup from listing the installed files of the systemd package.
e22195f to
f4992fa
Compare
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.
Summary
It's a bit hard to slouth why this code was added, however, it appears
to be to ensure the source code order of the keys was respected. With
PEP 520, this should no longer be an issue, as it ensures class
namespace ordering since Python 3.7.
Additionally, previously, some python source code garbage was finding
it's way in the variable, e.g.
Before:
Now
This also provides a nice speedup throughout the codebase, in one case
providing up to a 1.42x speedup from listing the installed files of the
systemd package.
Test Plan
Run a few eopkg operations, install, remove, info, li, la, lu etc.
Print out decl_order before and after, verifying it was the same except for the garbage python source code inserts now removed