Skip to content

Add typography benchmark tests for textToContours() - #9268

Draft
LalitNarayanYadav wants to merge 1 commit into
processing:mainfrom
LalitNarayanYadav:bench/text-to-contours
Draft

LalitNarayanYadav wants to merge 1 commit into
processing:mainfrom
LalitNarayanYadav:bench/text-to-contours

Conversation

@LalitNarayanYadav

@LalitNarayanYadav LalitNarayanYadav commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Resolves #8968

Changes:

  • Adds textToContours() benchmarks to test/bench/typography.bench.js, continuing Add typography performance tests #8918
  • TO_CONTOURS_CASES is derived from TO_POINTS_CASES, so the strings, text sizes and sampleFactor are identical across the textTo___ benchmarks
  • Adds a drawContours() helper for the render: true case
  • Adds the contours suite to the 2D, WebGL and WebGPU describe blocks
  • Asserts the total point count across contours matches the existing textToPoints() expectations (same sampleFactor: 0.5, same variance)
  • Verified with npx vitest bench --run test/bench/typography.bench.js --project unit-tests-webgpu -t "textToContours", which passes for 2D, WebGL and WebGPU

Note: the render case is about 10x slower than the non-render case in WebGL and WebGPU, because drawContours() calls beginShape/endShape once per contour.

cc @shakeelmohamed for review.

Screenshots of the change:
N/A (benchmark tests only)

PR Checklist

@LalitNarayanYadav LalitNarayanYadav changed the title Add textToContours() benchmark tests Add typography benchmark tests for textToContours() Oct 10, 2026
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.

Add typography benchmark tests for textToContours()

1 participant