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 6660431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:09:16+00:00 2026-05-26T02:09:16+00:00

My project has an HTML5 Canvas on which graphical objects are drawn repeatedly. These

  • 0

My project has an HTML5 Canvas on which graphical objects are drawn repeatedly. These objects change rapidly. Drawing them takes time. How can I make it faster?

The objects are not overly complex but contain things like arcs, gradients, polygons.

The look of an object depends on about 10 properties which each have one of about 10 values. That means that there are only about 100 different appearances than an object can have. That’s why I’m thinking about only drawing each appearance once and then caching a bitmap for re-use.

Everything must work on the client (i.e. I cannot use ready-made images)

  1. What would be the best way to do this with HTML5 Canvas?
  2. Is it a good idea at all or is the overhead of working with bitmaps greater than re-drawing the objects every time?
  • 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-05-26T02:09:16+00:00Added an answer on May 26, 2026 at 2:09 am

    Cache cache cache! Check out this article by Simon Sarris, and my own findings. Basically you make a canvas in memory copy the contents there and you can reuse them. You will see huge performance increases doing this.

    Rotating sprites without caching

    Rotating sprites WITH caching (walk upwards to find the zombies)

    You should see a pretty big improvement in the 2nd example.

    EDIT

    jsfiddle example cached

    jsfiddle example not cached

    Simon posted this in the comments, which should really clear things up if you can’t see the performance gains by just looking at the demos.

    JSperf findings by Simon Sarris

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

Sidebar

Related Questions

I've been working on a project which has an HTML5 video embedded. It works
A Project has multiple Tasks, which has multiple Assignments Projects (1-n) -> Tasks (1-n)
For a little project about XML I try to use HTML5 as it has
I am working on a Django project, in which a template login.html has code
My project has both client and server components in the same solution file. I
My project has collected CSS entropy (unused classes) during its course of development. Now
Our project has one folder that is not part of the solution. How can
My project has multiple themes with different colors. I need to skin certain textboxes
The project has been working fine in 2003 but when opening it in 2008
My Project has 2 java files (A.java and B.java in same package). A.java uses

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.