Skip to content

Replace almost all pp.Combine() into pp.Regex() #60

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

embar-
Copy link

@embar- embar- commented Mar 1, 2025

Majority of pp.Combine() are replaced into pp.Regex() for optimization.
Only this one line is not changed:

enum_name = pp.Combine(name("schema") + '.' + name("name")) | name("name")

This will contribute to #59 solving

Some metrics:

Screenshot_20250301_183646- Screenshot_20250301_183823+
Before After
diagram- diagram+
Before After

@Vanderhoof
Copy link
Owner

So I took a look, there are 19 failing tests after applying this PR. But what concerns me most is that using pp.Regex negatively impacts readability of the code. After all, why use Pyparsing then, if we end up with regex's anyway. But you are right, current PyDBML performance is terrible.

But thanks a lot for the contribution! I'll have to invest some time into the problem, and will use your changes as a basis

@embar-
Copy link
Author

embar- commented Mar 12, 2025

Regarding better readability – you can always add comments for it.

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

Successfully merging this pull request may close these issues.

2 participants