A
A
AlexXsWx2012-09-19 18:16:02
JavaScript
AlexXsWx, 2012-09-19 18:16:02

Browser performance?

I decided to find out which of the ways to draw a tile map would be faster - once to draw the entire map into a texture, and then draw it - or to form the necessary piece of tiles every frame. While writing a test program, I got a strange result.
The program creates a main canvas, 640x480, and a texture canvas - 10 times larger. The test function draws the texture on the main canvas many times, in random coordinates. It is called 5 times in a row, after which there is a pause for 5 seconds. The question is why the same function is executed more and more slowly from time to time? This is hardly noticeable in firelis, but very clearly visible in chrome - the execution time of the 1st and 5th times differs by 10 times.
Demo

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question