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

Avoid unnecessary memory allocations #352

Merged
merged 2 commits into from
Apr 30, 2017
Merged

Avoid unnecessary memory allocations #352

merged 2 commits into from
Apr 30, 2017

Conversation

pnordhus
Copy link
Contributor

These commits reduce the number of memory allocations (in my test cases by about 15%).

GenericVector should not prematurely allocate memory in the default constructor since quite a lot of vectors stay empty and there is no overhead in doing the allocation later.

Also, I don't see any reason to do the extra allocation in LanguageModelDawgInfo.

@zdenop zdenop assigned zdenop and theraysmith and unassigned zdenop Dec 8, 2016
Copy link
Contributor

@stweil stweil left a comment

Choose a reason for hiding this comment

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

Nice improvement!

@zdenop zdenop merged commit fd3f8f9 into tesseract-ocr:master Apr 30, 2017
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.

4 participants