Added my benchmark program here:

https://gitlab.freedesktop.org/AdbhutDev/duetest

Usage:
Clone the repo, and execute "cargo build --release" under `duetest/`

The binary can be found under `target/release`

It needs the location of the font file as an argument.

> With 'FreeType' you mean the standard rasterizer in `src/smooth`,
right?

Yes, all these benchmarks were done with `smooth`. To be exact the project uses 
"freetype-rs" which itself seems to use "freetype-sys" which according to their 
GitHub uses FreeType 2.12.1, I couldn't find the function to print the library 
version in the binding so can't confirm.

> What exactly did you compare time-wise with FreeType's 'smooth'
render?

The original rust version.

I am now trying to run my port under this benchmark by modifying the 
freetype-sys create, will report my findings.

Also, I was running the benchmark with 500 iterations, however increasing the 
iteration count to 5000 seems to give fontdue an advantage.

Another caveat, it is currently only testing the lowercase English alphabet.

I am working on graphing my findings so that it's easier to draw conclusions.

Regards,
Anurag

________________________________
From: Werner LEMBERG <w...@gnu.org>
Sent: Saturday, August 5, 2023 9:57:06 am
To: Anurag Thakur <anurag105cse...@bpitindia.edu.in>
Cc: freetype-devel@nongnu.org <freetype-devel@nongnu.org>; 
raph.lev...@gmail.com <raph.lev...@gmail.com>
Subject: Re: Progress update on alternative rendering engines project


Hello Anurag,


> From what I understood, the main performance improvement that
> fontdue claims to have is that it stores the font outlines
> differently, i.e. it seems to perform the curve flattening at
> initial load and stores the outline in the form of "v_lines" and
> "m_lines", presumably indicating "vertical lines" and lines spanning
> "multiple pixels horizontally".
>
> While trying to implement and benchmark it, I realized I had made a
> mistake in my previous benchmarks : I did not disable hinting.
>
> Fontdue does not support hinting, while the default mode for
> FreeType seems to have hinting enabled, leading to a decrease in
> performance.  This was also an issue with the benchmark program used
> by fontdue.
>
> I created a small benchmark program and reran the benchmarks with
> hinting disabled, and as expected freetype was much faster with
> hinting disabled.  So much so that on arm64 where there is no SIMD
> in fontdue, FreeType is faster in every single case.

With 'FreeType' you mean the standard rasterizer in `src/smooth`,
right?

> Its only with SIMD optimizations that fontdue is faster in a small
> range of sizes.

Very interesting!  Raph, can you comment, please?  You can find
Anurag's comparison images at

  https://lists.nongnu.org/archive/html/freetype-devel/2023-08/msg00008.html

> I have also discovered some sort of regression with the `smooth`
> rasterizer using the font "Cascadia Code".  Its performance degrades
> rapidly when rendering that font.  A preliminary check indicates
> something to do with "overlap_spans", I will send the `perf` results
> as well ASAP.

Thanks in advance.

> While I am trying to investigate more thoroughly, the benchmarks at
> first glance seem to indicate that only the SIMD improvement is
> worth considering and the other claims of performance don't seem to
> work well.

What exactly did you compare time-wise with FreeType's 'smooth'
render?  The original Rust version of 'fontdue', or your conversion of
'fontdue' into a FreeType driver module written in C?

  https://gitlab.freedesktop.org/freetype/freetype/-/tree/gsoc-anurag-2023


    Werner

Reply via email to