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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:21:13+00:00 2026-06-14T10:21:13+00:00

I am doing an experiment and attempting to improve the max particle count before

  • 0

I am doing an experiment and attempting to improve the max particle count before frame-rates start to drop in HTML5 Canvas.

I’m using requestAnimationFrame, I’m using drawImage from a canvas as this seems to be the fastest method for rendering images (as tested on jsPerf).

There’s a working jsFiddle here: http://fiddle.jshell.net/bewYC/5/

You might have to refresh or re-run a few times to get it to work (no idea why but it just doesn’t want to run on the first page load.)

As is, my computer running Chrome 22 can maintain 60FPS with about 5,000 particles. With every step above that, FPS starts to drop. If I remove drawImage() and just calculate the particles’ positions, my processor doesn’t max out until well over 10X as many particles.

What I want to know:
Is there is a faster way to render a large amount of particles (say 40,000 for example) than using a loop with drawImage in it? I especially want to know this about JavaScript/Canvas, but if you only have knowledge about another language such as Java or C#, then please share anyway.

  • 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-14T10:21:14+00:00Added an answer on June 14, 2026 at 10:21 am

    For this problem, using WebGL (or other “3D” API as appropriate for your platform) is nearly always the best way to do it. Compositing lots of images ("textures", rather) at moving positions is exactly what graphics hardware is designed to be good for. Modern browsers do use GPU acceleration for performing 2D-Canvas drawing operations, but there is still JavaScript requesting the drawing of each individual image, and that’s the problem.

    I recommend you check out WebGL — for simple things like a particle system it’s not hard to program at all, and you can easily render thousands of particles. Your JavaScript simply provides an array containing the positions of all the particles.

    An advanced technique is to put the simulation of the particles as well on the GPU, thus requiring no JavaScript to execute per-particle at all. I have myself written a GPU particle simulator in my GLToy. Here it’s configured for 80,000 particles and that achieves 60 FPS on my laptop. In fact, the limitation in that particular configuration is the fill-rate of the smooth particles; if we just use points I can push it up to 300,000 particles. And I am no wizard of graphics programming; I’m sure someone who knows exactly what to do could push it further.

    (P.S. links may be fragile as I revise GLToy; if you don’t get the named effects please let me know so I can fix the links.)

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

Sidebar

Related Questions

I'm doing a little experiment trying to randomly place images inside a div using
I'm doing some threaded asynchronous networking experiment in python, using UDP. I'd like to
I've been creating a little experiment in HTML5 Canvas of a car with some
While doing some experiment on serialization, I noticed that my object name is lost
I get this problem while doing some experiment with set . I use a
I was doing a little experiment with virtual destructors to review - wondering if
I'm doing a little experiment, trying to alternate background colours for nested divs. This
Doing an ajax get request works as expected using the following code: $.ajax({ type:
I have the following array below, doing an experiment on union operator. $a =
I am doing a server stress testing using Apache Benchmark Tool and Apache jMeter.

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.