Jump to content

Optimization, how far do you go?


marcgfx
 Share

Recommended Posts

Optimization is a task that is never done, or so it seems to me. I started off struggling with performance with just a few units, now I'm struggling with a few hundred. But I never stopped struggling, because as soon as I managed to get any improvement I also pushed the new limits.

So far it was always fairly clear where to optimize, while using the profiler. But lately it's been getting very hard. Today I optimized a function that checks if a unit collides with the outer boundaries of the world. I could not find a way to optimize the function, but I now only call the function when a unit it close to the edge. This brought me a whopping gain of ~1%. This sounds more impressive, if you consider the performance consumed by that function was ~1%.

I've noticed it seems to be better to optimize the way something is done, than to optimize the actual functions. I was wondering if anyone here knows any good strategies to find bottle necks that are hard to profile.

On a side note: I am displaying a minimap (canvas) and manipulate pixels directly. This is slower than the the WebGL draw calls for the whole scene. Is that to be expected?

The game I'm trying to optimize (use Chrome or get even worse Performance :P):

http://data.cyberlympics.com/html/game.html?param=Devader_1

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...

Honestly this might sound simple, but sometimes I just remove a specific chunk of code. I generally have some bad feelings about that peice of code's performance, and if the game runs faster (even though broken in most cases), I now know where to look.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...