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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Change if condition typo in _get_children_of_element() #313

Merged
merged 3 commits into from
Jun 13, 2024

Conversation

holtskinner
Copy link
Member

@holtskinner holtskinner commented Jun 12, 2024

The previous if condition was inefficient and should have been written with an and This resulted in a performance gap.

cProfile timing of export_hocr_string() on the same document

Before

143598720 function calls (129111346 primitive calls) in 44.487 seconds

After

97883150 function calls (88084552 primitive calls) in 30.235 seconds

Fixes #312 馃

Fixes #312

The previous `if` condition was inefficient and should have been written with an `and`
This resulted in a large performance gap.

cProfile timing of `export_hocr_string()` on the same document

Before
```
143598720 function calls (129111346 primitive calls) in 44.487 seconds
```

After

```
7615212 function calls (7069249 primitive calls) in 2.921 seconds
```
@holtskinner holtskinner requested review from a team as code owners June 12, 2024 21:18
@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Jun 12, 2024
@parthea parthea assigned holtskinner and unassigned parthea Jun 12, 2024
@parthea parthea assigned parthea and unassigned holtskinner Jun 12, 2024
@holtskinner holtskinner enabled auto-merge (squash) June 12, 2024 22:21
@holtskinner holtskinner merged commit 7495e0e into main Jun 13, 2024
22 checks passed
@holtskinner holtskinner deleted the hocr-efficiency branch June 13, 2024 14:14
holtskinner added a commit that referenced this pull request Jul 2, 2024
Fixes #312 馃

Improves upon the hOCR processing improvements made in #313
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

High latency exporting to hocr
2 participants