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

30x slower depending on the ttfunk v1.6.x or later than depending on the ttfunk v1.5.x #104

Closed
hidakatsuya opened this issue Jun 8, 2020 · 2 comments

Comments

@hidakatsuya
Copy link
Member

hidakatsuya commented Jun 8, 2020

Problem

ttfunk is a font metrics parser for prawn. And prawn v2.2 depends on ttfunk ~> 1.5, so thinreports-generator that depend on prawn also depend on either ttfunk version v1.5.x or v1.6.x.

However, ttfunk v1.6.x is known to have the following performance issue:
prawnpdf/ttfunk#82

As a result, PDF generation performance will also be reduced in environments and applications where thinreports-generator depends on ttfunk version 1.6.

Solution

This problem can be solved by making the dependent ttfunk version explicit in 1.5.x:

# Gemfile
gem 'thinreports'
+ gem 'ttfunk', '~> 1.5.1`
@hidakatsuya hidakatsuya pinned this issue Jun 8, 2020
@hidakatsuya hidakatsuya changed the title 30x slower depending on ttfunk v1.6.x than depending on ttfunk v1.5.x 30x slower depending on the ttfunk v1.6.x or later than depending on the ttfunk v1.5.x Jan 18, 2021
@hidakatsuya
Copy link
Member Author

hidakatsuya commented Jan 18, 2021

Thinreports v0.12.0 was released yesterday, but this version has a note about the current status of this issue.

However, please note that there is no way to avoid this performance problem if you use prawn v2.3 or later, since prawn v2.3 or later depends on ttfunk v1.6 or later.

If you want to avoid this performance problem while using Thinreports v0.12.0, you can lock prawn with v2.2 in addition to ttfunk, as shown below:

# Gemfile
+ gem 'prawn', '~> 2.2.2'
gem 'ttfunk', '~> 1.5.1'

In addition, this performance issue is expected to be resolved in the pullrequest below.
prawnpdf/ttfunk#83

@hidakatsuya
Copy link
Member Author

Great performance tuning on ttfunk has been merged: prawnpdf/ttfunk#90

@hidakatsuya hidakatsuya unpinned this issue Nov 28, 2021
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

No branches or pull requests

1 participant