Skip to content
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

Trx parsing performance #1925

Merged
merged 3 commits into from
Sep 11, 2023
Merged

Conversation

farlee2121
Copy link
Contributor

WHAT

Dramatically improve trx result file parsing performance.

For ~2k unit tests, parse time went from ~260s (yikes) to <2s.

WHY

While testing for #1922, I noticed large test projects had a significant delay between the test console showing a complete run and the explorer showing a complete run. A bit of experimenting showed that trx parsing was the source of the slowness.

I'm surprised I didn't notice this sooner. I thought the performance issues were in the build/run phase and got tunnel vision. Trx parsing was causing the non-linear slowdowns on large projects.

HOW

XPath has known issues with performance for large documents.
So, I found a way to reduce the average selector scope. First I select a collection of test definitions or test results, then I query attributes relative to each test or result node.
Test definitions and results are then zipped together by id.

Overall, this requires a data model more closely reflecting the trx structure. It does slightly increase mapping complexity, but it drastically decreases document traversal via select statements.

Xpath's select has known performance issues on large documents.
Using relative selectors to reduce the scope of attribute queries
dramatically improves performance and stability with scale
Relative parsing required data models more aligned with the Trx file structure.
This made the old Trx data models an unnecessary layer of mapping.
So, this removes them and maps more directly from the new file-aligned
models directly to the explorer-aligned models
Copy link
Contributor

@baronfel baronfel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely lovely, and the changes to the parsing make sense to me overall. Good eye!

@baronfel baronfel merged commit 61c4d71 into ionide:main Sep 11, 2023
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