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

Reduce memory thrashing when optimising large PDFs #347

Merged
merged 1 commit into from
Feb 16, 2019

Conversation

c2h5oh
Copy link

@c2h5oh c2h5oh commented Feb 15, 2019

Before this change optimize.(*CombineDuplicateDirectObjects).Optimize has spent 97% of it's runtime in github.com/unidoc/unidoc/pdf/core.(*PdfObjectDictionary).WriteString and optimising a 500 page PDF with 4 images / page took a couple minutes on 8-thread cpu

After the change it's <1% and optimising the same file takes seconds.

@CLAassistant
Copy link

CLAassistant commented Feb 15, 2019

CLA assistant check
All committers have signed the CLA.

@c2h5oh c2h5oh changed the title Reduce memory thrashing when optimizing large PDFs Reduce memory thrashing when optimising large PDFs Feb 15, 2019
@codecov
Copy link

codecov bot commented Feb 15, 2019

Codecov Report

Merging #347 into v3 will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##               v3     #347      +/-   ##
==========================================
+ Coverage   52.61%   52.61%   +<.01%     
==========================================
  Files         145      145              
  Lines       25235    25236       +1     
==========================================
+ Hits        13277    13278       +1     
  Misses      10170    10170              
  Partials     1788     1788
Impacted Files Coverage Δ
pdf/core/primitives.go 75.15% <100%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d1cf1a...f03fb61. Read the comment docs.

@gunnsth gunnsth merged commit 23743a3 into unidoc:v3 Feb 16, 2019
@gunnsth
Copy link
Contributor

gunnsth commented Feb 16, 2019

Great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants