Skip to content

Shorter multiple imports#61

Open
embar- wants to merge 147 commits into
Vanderhoof:masterfrom
embar-:short_imports
Open

Shorter multiple imports#61
embar- wants to merge 147 commits into
Vanderhoof:masterfrom
embar-:short_imports

Conversation

@embar-

@embar- embar- commented Mar 12, 2025

Copy link
Copy Markdown

Moving multiple imports from same sources into single call.
This should reduce DBML parse time more than twice.
See #59

Vanderhoof and others added 25 commits August 11, 2024 09:20
- Integrated `prepare_text_for_dbml` into `default_to_str` for consistent handling of special characters in DBML column strings.
- Updated the test suite to include a new test case for handling binary string input (`b'0'`).
…default-escapse

Fix bug in DBML column default rendering with single quotes
…brackets

fix: line breaks in column and index options are allowed (Vanderhoof#48)
fix: quote tablegroup and project name on dbml render Vanderhoof#46
…_other_index_types

feat(indexes): support all Postgresql index types
@Vanderhoof

Vanderhoof commented Mar 12, 2025

Copy link
Copy Markdown
Owner

Actually imports organization should not affect the performance. Separate-line imports was a design choice when I was beginning the project, not so sure about it right now, because IDEs like PyCharm manage imports pretty good for you and separate-line imports do not really make much sense at this point. But again, this is just code organization and should not be related to performance issues

@embar-

embar- commented Mar 12, 2025

Copy link
Copy Markdown
Author

Initially I also had similar thoughts. But actually I am using PyCharm, and indeed reorganization of imports did trick - code is 2-3 times faster. Maybe this is because importing not just functions, but also variable declarations multiple times that calls pp many times.

@Vanderhoof

Copy link
Copy Markdown
Owner

That's really strange! I just tried parsing the same file with and without collapsed imports, and saw no difference (86ms with one-line imports and 87ms with collapsed)

@embar-

embar- commented Mar 12, 2025 via email

Copy link
Copy Markdown
Author

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.

10 participants