Conversation
02f55d3 to
62c028b
Compare
|
Yeah I think we first have to figure out how to deal with fontdb before doing anything with resvg. I don’t think RazrFalcon would want to switch it, and I’m not sure that fontique supports everything we need? |
|
It's an interesting experiment, but I don't see a point in it. Is there a reason in switching to PS: even if |
|
Oh wait, it depends on proc-macros/syn?! Burn it with fire! No proc-macros in |
harfrust is rustybuzz, just with ttf-parser switched out by read-fonts. It passes all the same tests, so it should be no less robust than then rustybuzz.
The reason is that going forward, (most likely) no one will be continually developing ttf-parser/rustybuzz, while harfrust will be actively maintained. |
|
I would suggest to come back to it in a year. No rush. And once again, proc-macros are no go. We have to figure out that one as well. |
Not sure about 'beta' type labels, but the first release (0.1.0) of HarfRust happened on June 10, marking a significant milestone.
For an immediate effect, it seems to be far more compliant when tested against the HarfBuzz test suite. To quote Chad:
And the HarfRust introduction post by Behdad contains the following claim:
Moving forward, HarfRust will receive active development and continuous sync with HarfBuzz, while RustyBuzz is likely to only see critical fixes. |
Apples and oranges, but sure. Either way, proc-macros is the current major roadblock. |
|
@RazrFalcon Seems like the proc-macros are coming from font-types which uses bytemuck and serde derive macros. Do we want to talk to them about converting to manual implementations? |
|
@mattfbacon if it's an easy fix - sure. |
|
No it wouldn't be at all, since the bytemuck derive macros generate unsafe code so they would need to allow unsafe code back into the codebase. But what is your plan here? Earlier you said wait, but for what? |
I would call it easy. It's not like the code deeply depends on proc-macros.
Adoption, etc. I don't see a point/reason in switching to 0.1. Especially if we would keep |
|
There are derive helpers based on It is likely possible to implement an alternative |
e29cfbe to
0973b97
Compare
harfrustharfrust and fontations
3c5c998 to
c05e2fd
Compare
As some months have passed another benefit has appeared - performance. In the last month the HarfRust vs HarfBuzz OpenType shaping performance difference has gone from ~4x to ~1.2x, which is a massive boost. Not quite on par with HarfBuzz yet, but getting a lot closer. More importantly for this PR here though, HarfRust is now a lot faster than RustyBuzz. |
|
The geometric mean of the last result is ~1.16, meaning Harfrust is now only 16% slower than Harfbuzz. |
It's even better than that. See the comment: In short, there's some hb-harfrust overhead included in the spreadsheet number. |
da2754d to
7e549e1
Compare
|
The variable diffs look reasonable to me and likely result from differences in fixed point vs floating point when processing deltas. |
|
I don't know what the status of this is, but harfrust 0.6.0 was released today |
Indeed, although it's just a dep bump release.
The remaining blocker is switching resvg to use |
The numbering is a bit strange. There were more changes in 0.5.1 and 0.5.2. Edit: I just realized that you were the one who bumped it 😂 |
Just normal SemVer I would assume. It looks like |
|
Can we make a move here? |
|
@behdad The latest discussion on this is https://xi.zulipchat.com/#narrow/channel/465085-resvg/topic/Moving.20resvg.20to.20fontations.2Fharfrust/with/572344735. TLDR is that we need to find a solution for the "font database". Either switching to Fontique (preferred but more work), or porting I have a branch on top of this one (https://github.com/nicoburns/resvg/commits/fontique) that partially moves resvg to fontique. However, that still needs a bunch of design work. Porting |
|
@RazrFalcon are you open to moving fontdb towards read-fonts? |
|
Just looked at this again, and the "blockers" (things that need to be worked out) for porting to Fontique are:
|
|
Perhaps we could start by migrating to @behdad How does |
This is also an option. Just this PR as-is would eliminate |
In our measurement, it's multiple times faster on a variety of benchmarks. Benchmarks from last year: https://docs.google.com/spreadsheets/d/1lyPPZHXIF8gE0Tpx7_IscwhwaZa4KOpdt7vnV0jQT9o/preview We have improved it more since. |
Signed-off-by: Nico Burns <nico@nicoburns.com>
Signed-off-by: Nico Burns <nico@nicoburns.com>
Signed-off-by: Nico Burns <nico@nicoburns.com>
Signed-off-by: Nico Burns <nico@nicoburns.com>
Signed-off-by: Nico Burns <nico@nicoburns.com>
Signed-off-by: Nico Burns <nico@nicoburns.com>
Signed-off-by: Nico Burns <nico@nicoburns.com>
Signed-off-by: Nico Burns <nico@nicoburns.com>
Signed-off-by: Nico Burns <nico@nicoburns.com>
|
I have:
|
|
I think As for repo, I can transfer it to someone. No need for a fork. Otherwise I'm fine with switching to |
Changes made
rustybuzzwithharfrustttf_parserwithskrifaNotes
1.65to1.80resvg.Production profile
The analysis below uses the following "production" profile:
Binary size analysis:
According to
cargo-bloat(not the most accurate):harfrustandrustybuzzare both ~250kbttf_parserandread-fontsare both ~100kbttf_parserincludes the metrics outlining functionality ofskrifa. And skrifa is another ~250kb.Compiling the CLI (which is a much more useful test) with the production profile above (
cargo build --profile production --bin resvg) I get:2.4mbformain2.9mbfor this PRSo this PR causes a binary increase of around
500kbCompile time analysis
Compile times on an M1 Pro (8+2 cores) are shown below (
cargo build):maindebugreleaseproductionSo this PR roughly doubles compile times at regular opt settings
(with the effect being less pronounced with LTO and other production optimisation settings enabled)