Skip to content

[api-minor] Create the css color to use with the canvas in the worker #19953

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2025

Conversation

calixteman
Copy link
Contributor

It slightly reduces the time spent to draw and the memory used.

@calixteman
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/43010c9ed1873cc/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/36f7b9d6a69d83a/output.txt

@calixteman calixteman force-pushed the rm_useless_arrays branch from 6c7e573 to 4906daa Compare May 18, 2025 19:18
@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/36f7b9d6a69d83a/output.txt

Total script time: 30.57 mins

  • Unit tests: FAILED
  • Integration Tests: FAILED
  • Regression tests: FAILED
  errors: 289

Image differences available at: http://54.241.84.105:8877/36f7b9d6a69d83a/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/43010c9ed1873cc/output.txt

Total script time: 58.22 mins

  • Unit tests: FAILED
  • Integration Tests: FAILED
  • Regression tests: FAILED
  errors: 289

Image differences available at: http://54.193.163.58:8877/43010c9ed1873cc/reftest-analyzer.html#web=eq.log

@calixteman
Copy link
Contributor Author

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/f2671812be702e9/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.193.163.58:8877/2841ba7635d6fed/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/f2671812be702e9/output.txt

Total script time: 29.80 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: Passed

@calixteman calixteman requested a review from Snuffleupagus May 18, 2025 21:48
@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/2841ba7635d6fed/output.txt

Total script time: 58.64 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: Passed

@Snuffleupagus Snuffleupagus changed the title Create the css color to use with the canvas in the worker [api-minor] Create the css color to use with the canvas in the worker May 19, 2025
Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It slightly reduces the time spent to draw and the memory used.

How much of an improvement are we talking about? Any benchmarking results from relevant PDF documents?


r=me, thank you.

@calixteman
Copy link
Contributor Author

It slightly reduces the time spent to draw and the memory used.

How much of an improvement are we talking about? Any benchmarking results from relevant PDF documents?

With the pdf:
https://issues.apache.org/jira/secure/attachment/13076505/72641_585_1_114077_6.pdf

Here are two profiles:

Without the patch we spend around 8ms to just create the css color in the main thread which isn't crazy for sure.
It's more interesting in the worker:

  • we spend 225ms in the new function getRgbHex (which is called 275674 times);
  • we spend 316ms in the old getRgb.

Since we don't create anymore the temporary arrays, we win in term of memory (~400K) which leads to win some time when GCing and when cloning the data to be sent to the main thread.

I've another patch to remove the subarrays on the qcms' side which should help to improve the performance of getRgbHex.

It slightly reduces the time spent to draw and the memory used.
@calixteman calixteman force-pushed the rm_useless_arrays branch from 4906daa to 5789afd Compare May 19, 2025 13:07
@calixteman
Copy link
Contributor Author

/botio-linux test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @calixteman received. Current queue size: 0

Live output at: http://54.241.84.105:8877/6da619b11cb68e7/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/6da619b11cb68e7/output.txt

Total script time: 30.13 mins

  • Unit tests: Passed
  • Integration Tests: FAILED
  • Regression tests: Passed

@calixteman calixteman merged commit 2b9f621 into mozilla:master May 19, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants