Skip to content

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
@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