Skip to content

Cache fontpath#157

Open
ffreyer wants to merge 1 commit into
Kolaru:masterfrom
ffreyer:ff/fontpath-caching
Open

Cache fontpath#157
ffreyer wants to merge 1 commit into
Kolaru:masterfrom
ffreyer:ff/fontpath-caching

Conversation

@ffreyer
Copy link
Copy Markdown
Contributor

@ffreyer ffreyer commented May 22, 2026

I tried to benchmark Makie LaTeXString updates and noticed that joinpath() is taking the majority of the update time.

using Makie, LaTeXStrings, BenchmarkTools
a = L"\sqrt{1-x}"
b = L"\frac{1}{x}"
f,ax,p = text(Point2f(0), text = a);

@benchmark begin
    $p.text = $a
    foreach(kv -> kv[2][], $p.plots[1].attributes.outputs)
    $p.text = $b
    foreach(kv -> kv[2][], $p.plots[1].attributes.outputs)
end

Caching fontname -> fullpath reduces this benchmark from about 1.2ms to 0.27ms.

@ffreyer
Copy link
Copy Markdown
Contributor Author

ffreyer commented May 22, 2026

I'm not sure if this change is fine to accept as is. Maybe precompilation can mess something up if paths change? The Dict is empty on reload so I guess that's not a problem.

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.43%. Comparing base (efdbaab) to head (3763561).
⚠️ Report is 26 commits behind head on master.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #157      +/-   ##
==========================================
+ Coverage   79.93%   84.43%   +4.49%     
==========================================
  Files          10       10              
  Lines         658      906     +248     
==========================================
+ Hits          526      765     +239     
- Misses        132      141       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants