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

Slow extraction after recent PRs #786

Closed
adbar opened this issue Feb 10, 2025 · 0 comments · Fixed by #772
Closed

Slow extraction after recent PRs #786

adbar opened this issue Feb 10, 2025 · 0 comments · Fixed by #772
Labels
bug Something isn't working

Comments

@adbar
Copy link
Owner

adbar commented Feb 10, 2025

Hi @unsleepy22, I just ran tests on the benchmark with pyinstrument tests/comparison_small.py and there seems to be an issue with your PR which improve the results but have a major cost in terms of timing (say 3-4x as slow overall).

The problem seems to be in determine_returnstring > xmltotxt > process_element. My guess is that a slow test with descendants or ancestors is run recursively although there is no need.

The function is_in_table_cell() is a potential culprit, its use should be limited to cases where it's absolutely necessary and/or there should be a better way to perform the test after all.

@adbar adbar added the bug Something isn't working label Feb 10, 2025
@adbar adbar linked a pull request Feb 11, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant