Closed jbphet closed 8 years ago
For memory profiling (checking for leaks), I performed the following tests:
autoAnswer
query param, finish all levels for all screens. This should be the point at which the max amount of memory is allocated. Take a snapshot, them play with the sim for several more minutes, then take another snapshot and compare. Do this again. Result: In this case, there does appear to be a bit of a leak. It's slow, roughly 1/2 MB each time all boards are filled on all levels.I will follow up on the potential leak with @jonathanolson, since my initial analysis is that the allocations are mostly scenery items (which doesn't necessarily implicate the scenery library, it may be how the sim is interacting with the library). I don't think that this should block the initial release candidate, since the leak is slow and would require many hours of play on the game before any impacts are likely to be seen.
Done, closing.
This sim was initially code reviewed before we had this checklist, so we should go through it is a separate pre-publication step.
Build and Run Checks
Repository structure
[x] Are all required files and directories present?
For a sim repository named “my-repo”, the general structure should look like this (where assets/, audio/ or images/ may be omitted if the sim doesn’t have those types of assets).
For a common-code repository, the structure is similar, but some of the files and directories may not be present if the repo doesn’t have audio, images, strings, or a demo application.
[x] Is the js/ directory properly structured?
All JavaScript source should be in the js/ directory. There should be a subdirectory for each screen (this also applies for single-screen sims). For a multi-screen sim, code shared by 2 or more screens should be in a js/common/ subdirectory. Model and view code should be in model/ and view/ subdirectories for each screen and common/. For example, for a sim with screens “Introduction” and “Custom”, the general directory structure should look like this:
grunt generate-published-README
orgrunt generate-unpublished-README
?chipper/js/grunt/Gruntfile.js
?Coding conventions
Documentation
Common Errors
Math.round
used wheredot.Util.roundSymmetric
should be used? Math.round does not treat positive and negative numbers symmetrically, see https://github.com/phetsims/dot/issues/35#issuecomment-113587879toFixed
used wheredot.Util.toFixed
ordot.Util.toFixedNumber
should be used? JavaScript'stoFixed
is notoriously buggy, behavior differs depending on browser, because the spec doesn't specify whether to round or floor.Organization, Readability, Maintainability
Performance, Usability
Memory Leaks
tandem.addInstance
should be accompanied bytandem.removeInstance
or documented why removeInstance is unnecessary.