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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:54:58+00:00 2026-06-04T19:54:58+00:00

I was doing some experiments with HTML5 lately and noticed that HTML5 appears to

  • 0

I was doing some experiments with HTML5 lately and noticed that HTML5 appears to run quite poorly on mobile, tablets, and even desktops. I conducted the following test:

150 elements moving across the page with jQuery
http://erality.com/public/html5/001/

25 elements move across the page with HTML5
http://erality.com/public/html5/002/

The jQuery version runs well on desktop and fairly well on newer tablets. The HTML5 version (with 1/6th the elements) runs poorly on a desktop and is horrible on tablets. Is this normal performance? Am I doing something incorrectly?

Any insight would be helpful.

  • 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-04T19:55:00+00:00Added an answer on June 4, 2026 at 7:55 pm

    The poor performance on the “HTML5” version is explained by its use of setTimeout instead of requestAnimationFrame (RAF), which is the suggested method of animating anything with an HTML5 canvas. Look here for more info on RAF.

    Edit: I should have written “is partially explained by”

    Besides RAF, you should try using setInterval instead of setTimeout. Also, why is there a random factor to the duration of each setTimeout? If you don’t want to use RAF, I suggest using setInterval with a fixed interval (try 16ms for starters) while updating all petals at each interval. Currently you’re using a separate setTimeout for each petal, with a random duration, which is probably causing a lot of the lag.

    Here is a good MSDN article about the performance benefits of RAF. It compares RAF with setTimeout/setInterval. A few relevant quotes from the article:

    As a result, applications are perfectly aligned with the browser painting interval and uses only the appropriate amount of resources.

    Also:

    Every third draw cannot be painted because another draw request occurs before the display refresh interval. This overdrawing results in choppy animations because every third frame is lost. This timer resolution reduction can also negatively impact battery life by up to 25%.

    Using setTimeout may not account entirely for the performance difference in your examples. Others have noted that the comparison is not apples-to-apples. You should be able to get faster animation with setTimeout (I’ve written a fairly smooth physics sim with setTimeout). Regardless, RAF is much superior to setTimeout, and is the only way to get the smoothest of smooth animations.

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

Sidebar

Related Questions

While doing some experiment on serialization, I noticed that my object name is lost
While doing some refactoring I've found that I'm quite often using a pair or
I've been doing some experiments with the Cell processor in a PS3 that I
I am doing (want to do) some experiments with Linked Open Datasets particularly those
I am doing some experiments on my device - I want to be able
Ok, so I've been doing some experiments with hash tables and different collision resolution
I'm looking at doing some initial tests and experiments with a toy language and
I'm doing some small experiments based on this blog entry . I am doing
I'm studying Knockoutjs and I'm doing some low-level experiments. Following an existing jsFiddle ko
I'm doing some experiments with opengl in c for linux. I've got the following

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.