Skip to content

Instantly share code, notes, and snippets.

@MadLittleMods
Last active August 29, 2015 14:06
Show Gist options
  • Save MadLittleMods/5fdcce56915dffaae828 to your computer and use it in GitHub Desktop.
Save MadLittleMods/5fdcce56915dffaae828 to your computer and use it in GitHub Desktop.

Skippy Fish Performance Suggestions

  • Remove any console.log calls in update loops
  • Remove Crafty.c("BG") in Components.js
    • Not needed, background already in Game.load:game.js
  • Remove the $("#currentDistance") in Crafty.c("Fish").update: components.js
    • This is not even in use anymore - could remove from reset as well
  • Remove the $("#currentAltitude") block in Crafty.c("Fish").update: components.js
    • This is not even in use anymore - could remove from reset as well
  • Remove the $("#currentSkips") block in Crafty.c("Fish").update: components.js
    • This is not even in use anymore - could remove from reset as well
  • Remove the Crafty.c("Killer Fish") EnterFrame update bind because it is empty
  • Cache dom nodes used in update loops

I think there is a memory leak in the original latest code because the heap grows over time. With my modifications (more than listed here), it was a stable saw-tooth pattern.

I am not sure of the extent of the performance improvements as it runs a stable 60 fps when idle. when running a YouTube video just to dumb down the CPU a bit, playing produces variable fps measurements in both the original and modified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment