We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8da2642 commit 34f110fCopy full SHA for 34f110f
1 file changed
src/ImageSharp.Drawing/Processing/Backends/DefaultRasterizer.cs
@@ -330,10 +330,11 @@ private static bool TryRasterizeParallel(
330
}
331
332
int tileCount = (height + tileHeight - 1) / tileHeight;
333
- if (tileCount == 1)
+ if (tileCount == 1 || edgeCount <= 64)
334
{
335
- // Tiny workload fast path: avoid bucket construction and worker scheduling
336
- // when everything fits in a single tile.
+ // Small-geometry fast path: for paths with few edges (e.g. a stroked line
+ // producing ~6-10 edges), iterating all edges against all rows is far cheaper
337
+ // than the allocation overhead of band sorting + Parallel.For scheduling.
338
RasterizeSingleTileDirect(
339
edgeMemory.Span[..edgeCount],
340
width,
0 commit comments