Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9209763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:55:19+00:00 2026-06-18T00:55:19+00:00

I just hit something particularly hard to debug when doing some pretty intensive rendering

  • 0

I just hit something particularly hard to debug when doing some pretty intensive rendering with Canvas2D. I use all kinds of things, from globalCompositeOperation to multiple off-screen canvases, with some drawImage magic in-between.

It works perfectly fine and smooth on :

  • Chrome (26) [OSX 10.7.5]
  • Safari (6.0.2) [OSX 10.7.5]
  • Firefox (Both 18 and 20 Aurora) [OSX 10.7.5]
  • Chrome (24) [Windows 7]
  • Firefox (12) [Windows 7]
  • Chromium (24) [Archlinux, Gnome 3]

EDIT: Added tests for Windows 7. Strangely enough, it works for FF12 (I had an old version on my dual boot) but there’s a definite performance hit after upgrading to FF18. It’s not as bad on Windows as it is on Linux though, and the same version on OSX works flawlessly. Regression maybe?

For some reason, on Firefox and Linux (I tried both 18 and 20 Aurora), I have bad rendering performances when dragging and rendering at the same time.

If I fire-and-forget an animation, it is on par with Chrome/Safari, but if I drag and render, I often end up only seeing the end frame after I release the drag.

  • Neither requestAnimationFrame nor a direct rendering on the mouse event handler work.
  • After profiling, the reported timings for the rendering parts are well within the range of acceptable (up to 100ms at the absolute worst), and definitely do not correspond to what I see on the screen.
  • I tried reducing the load by removing some stuff, ending up with reported render times under 15ms, but what I saw didn’t change.

What baffles me is that it works almost everywhere else except with Firefox on Linux. Any idea as to where I should look, a bug report or a solution to my problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T00:55:20+00:00Added an answer on June 18, 2026 at 12:55 am

    I think I know where you should look based on this:

    If I fire-and-forget an animation, it is on par with Chrome/Safari, but if I drag and render, I often end up only seeing the end frame after I release the drag.

    This is probably a double-buffering bug with Firefox on linux.

    Canvas implementations have double-buffering built in. You can see it in action on any browser in a simple example like this one: http://jsfiddle.net/simonsarris/XzAjv/ (which uses a setTimeout vs extra work to illustrate that clearing does not happen right away)

    The implementations try to delay all rendering by rendering it to an internal bitmap, and then all at once (at the next pause) render it to the canvas. This stops the “flickering” effect when clearing a canvas before redrawing a scene, which is good.

    But it seems there’s a plain old bug in the Linux Firefox. During your drag and render it seems to not be updating the canvas, probably in an attempt to buffer, but seems to be doing so when it should not be. This would explain why it works in fire-and-forget scenarios.


    So I think a bug report is in order. I haven’t got any linux machines lying around so I can’t reproduce it and submit something myself to be certain though, sorry.


    This is in reply to a comment: You could, during the mouse move, dispatch the drawing portion to a tiny timer.

    For instance:

    // The old way
    theCanvas.addEventListener('mousemove', function() {
      // if we're dragging and are redrawing
      drawingCode();
    }, false);
    
    // The new way
    theCanvas.addEventListener('mousemove', function() {
      // if we're dragging and are redrawing
    
      // in 1 millisecond, fire off drawing code
      setTimeout(function() { drawingCode(); }, 1);
    }, false);
    

    There isn’t such a method, its totally hidden. What you could do is, during mouse move, dispatch

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm just getting my feet wet with Ember.js, and I've hit something that I'm
Just learning rails, am on to migrations and it all started off pretty logically
It just hit me the other day. What actually happens when I tell the
I just seem to hit one error after another when dealing with larger projects
load() just returns a proxy by default and database won’t be hit until the
I'm just getting started with flask and I've hit a snag. I'm trying to
I'm just playing around with FastMember and have hit a problem. Each time I
I was just playing around with IOS and I hit a problem and it
today i hit a really annoing problem with wpf. i just want to align
I just downloaded the Orchard CMS , opened it up in VS2008 and hit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.