RESOLVED DUPLICATE of bug 266181 263013
Canvas.drawImage() is very slow in private mode
https://bugs.webkit.org/show_bug.cgi?id=263013
Summary Canvas.drawImage() is very slow in private mode
Luca Moroni
Reported 2023-10-11 07:09:15 PDT
Created attachment 468172 [details] a video recorded on iPhone11 that reproduces the issue Hello, I've found an issue where the cavas.drawImage() API is up to 100 times slower on private mode than on "normal" mode. I've been able to test the issue on: - iOS 17.0.3 - iPhone 11 - iOS 17.0.2 - iPhone SE 2nd gen - Safari 17.0 (18616.1.27.111.22, 18616) - MacBook Pro 14-inch, 2021 M1 - MacOS 13.6 (22G120) And I've registered a slow down in all these devices. I've put together a demo code pen that reproduces the issue: https://codepen.io/esnhoesnho/pen/NWeJdRV?editors=1010 To reproduce the bug just open the link above in private mode. The UI will print the measured milliseconds on top of the page. I attach a video recorded on iPhone11. Thanks, Luca
Attachments
a video recorded on iPhone11 that reproduces the issue (6.00 MB, video/quicktime)
2023-10-11 07:09 PDT, Luca Moroni
no flags
Radar WebKit Bug Importer
Comment 1 2023-10-18 07:10:16 PDT
Paul Neave
Comment 2 2023-12-15 10:48:03 PST
This bug occurs when Advanced Tracking and Fingerprinting Protection is enabled. This is on by default for private tabs in Safari 17. I've filed an example in bug #266473. Try the following example code with "Use advanced tracking and fingerprinting protection" setting enabled under Settings > Advanced > Privacy. Website are unusable in this state. ` <html> <body> <canvas id="canvas"></canvas> <script> const width = 800; const height = 800; const canvas = document.getElementById('canvas'); canvas.width = width; canvas.height = height; const context = canvas.getContext('2d'); const imageCanvas = document.createElement('canvas'); imageCanvas.width = width; imageCanvas.height = height; const imageContext = imageCanvas.getContext('2d'); imageContext.fillStyle = 'red'; imageContext.fillRect(0, 0, width, height); console.time('drawImage'); context.drawImage(imageCanvas, 0, 0); console.timeEnd('drawImage'); </script> </body> </html> `
Luca Moroni
Comment 3 2023-12-22 06:27:10 PST
I confirm, this bug and #266473 looks the same. I've got the feeling the the overall stability is reduced while working with canvases on 17.x . But this is hard to reduce to a simple example. I hope that at least this issue will be mitigated in future releases.
Matthew Finkel
Comment 4 2024-01-13 13:31:35 PST
Thanks for reporting this, a fix for this is being work on in bug 266181. *** This bug has been marked as a duplicate of bug 266181 ***
Note You need to log in before you can comment on or make changes to this bug.