Prerequisites
(Wasn't sure if this should go here or in SixLabors.Fonts)
I'm trying to convert a working game engine from system.drawing, but my game engine (which usually hits 60 FPS without a problem) shows less than 10 FPS, due to a debug label which shows the cursor position and constantly updates as the cursor moves.
When I measured the text rendering time, I saw that ImageSharp.Drawing takes somewhat between 90ms and 170ms (median: 134ms) to render the text, and system.drawing takes ~0.3ms for rendering the text, so somewhat between x300 and x400 better performance.
Here's the analysis from xamarin profiler:

FindIntersectionWithOrientation seems to be the biggest bottleneck: I'm completely ignorant when it comes to text rendering, I'm curious why we even need to find intersections when rendering text, I always imagined a glyph is just a series of path instructions that you map to size and render as is.
Steps to Reproduce
If you want to compare to the system.drawing version, checkout the master branch, the equivalent line is here:
https://github.com/tzachshabtay/MonoAGS/blob/cadd7acbef6b1a97e47166681ba7e349074c4b47/Source/Engine/AGS.Engine.Desktop/Drawing/DesktopBitmapTextDraw.cs#L93
System Configuration
- ImageSharp.Drawing version: 1.0.0-beta0009
- Other ImageSharp packages and versions: ImageSharp 1.0.0-rc0003
- Environment (Operating system, version and so on): Mac OSX Mojave 10.14
- .NET Framework version:
Mono JIT compiler version 6.4.0.208 (2019-06/07c23f2ca43 Wed Oct 2 04:52:23 EDT 2019)
Prerequisites
DEBUGandRELEASEmode(Wasn't sure if this should go here or in
SixLabors.Fonts)I'm trying to convert a working game engine from
system.drawing, but my game engine (which usually hits 60 FPS without a problem) shows less than 10 FPS, due to a debug label which shows the cursor position and constantly updates as the cursor moves.When I measured the text rendering time, I saw that
ImageSharp.Drawingtakes somewhat between 90ms and 170ms (median: 134ms) to render the text, andsystem.drawingtakes ~0.3ms for rendering the text, so somewhat between x300 and x400 better performance.Here's the analysis from xamarin profiler:

FindIntersectionWithOrientationseems to be the biggest bottleneck: I'm completely ignorant when it comes to text rendering, I'm curious why we even need to find intersections when rendering text, I always imagined a glyph is just a series of path instructions that you map to size and render as is.Steps to Reproduce
DemoDesktopfrom here: https://github.com/tzachshabtay/MonoAGS/tree/ImageSharp (using Visual Studio for Mac)If you want to compare to the
system.drawingversion, checkout the master branch, the equivalent line is here:https://github.com/tzachshabtay/MonoAGS/blob/cadd7acbef6b1a97e47166681ba7e349074c4b47/Source/Engine/AGS.Engine.Desktop/Drawing/DesktopBitmapTextDraw.cs#L93
System Configuration
Mono JIT compiler version 6.4.0.208 (2019-06/07c23f2ca43 Wed Oct 2 04:52:23 EDT 2019)