- Create arrays with required size to prevent reallocation overhead
var visible = new Array(required_size);
You can look at good overview for array allocations good overview for array allocations from codereview, but different topic.
GC cleans temporary objects and time it need to clean them depends on their number, so you can use closure compiler to inline everything that can be inlined to decrease number of objects GC had to process.
Not GC optimization, but related to performance: do not search DOM element frequently, save link to them and reuse variable.
var killsLabel = document.getElementById("killsText");
// when you need it
killsLabel.innerHTML = "Score: " + playerData.score;
- Create arrays with required size to prevent reallocation overhead
var visible = new Array(required_size);
You can look at good overview for array allocations from codereview, but different topic.
GC cleans temporary objects and time it need to clean them depends on their number, so you can use closure compiler to inline everything that can be inlined to decrease number of objects GC had to process.
Not GC optimization, but related to performance: do not search DOM element frequently, save link to them and reuse variable.
var killsLabel = document.getElementById("killsText");
// when you need it
killsLabel.innerHTML = "Score: " + playerData.score;
- Create arrays with required size to prevent reallocation overhead
var visible = new Array(required_size);
You can look at good overview for array allocations from codereview, but different topic.
GC cleans temporary objects and time it need to clean them depends on their number, so you can use closure compiler to inline everything that can be inlined to decrease number of objects GC had to process.
Not GC optimization, but related to performance: do not search DOM element frequently, save link to them and reuse variable.
var killsLabel = document.getElementById("killsText");
// when you need it
killsLabel.innerHTML = "Score: " + playerData.score;
- Create arrays with required size to prevent reallocation overhead
var visible = new Array(required_size);
You can look at good overview for array allocations from codereview, but different topic.
GC cleans temporary objects and time it need to clean them depends on their number, so you can use closure compiler to inline everything that can be inlined to decrease number of objects GC had to process.
Not GC optimization, but related to performance: do not search DOM element frequently, save link to them and reuse variable.
var killsLabel = document.getElementById("killsText");
// when you need it
killsLabel.innerHTML = "Score: " + playerData.score;
- Create arrays with required size to prevent reallocation overhead
var visible = new Array(required_size);
GC cleans temporary objects and time it need to clean them depends on their number, so you can use closure compiler to inline everything that can be inlined to decrease number of objects GC had to process.
Not GC optimization, but related to performance: do not search DOM element frequently, save link to them and reuse variable.
var killsLabel = document.getElementById("killsText");
// when you need it
killsLabel.innerHTML = "Score: " + playerData.score;
- Create arrays with required size to prevent reallocation overhead
var visible = new Array(required_size);
You can look at good overview for array allocations from codereview, but different topic.
GC cleans temporary objects and time it need to clean them depends on their number, so you can use closure compiler to inline everything that can be inlined to decrease number of objects GC had to process.
Not GC optimization, but related to performance: do not search DOM element frequently, save link to them and reuse variable.
var killsLabel = document.getElementById("killsText");
// when you need it
killsLabel.innerHTML = "Score: " + playerData.score;
- Create arrays with required size to prevent reallocation overhead
var visible = new Array(required_size);
- GC cleans temporary objects and time it need to clean them depends on their number, so you can use closure compiler to inline everything that can be inlined to decrease number of objects GC had to process.
GC cleans temporary objects and time it need to clean them depends on their number, so you can use closure compiler to inline everything that can be inlined to decrease number of objects GC had to process.
Not GC optimization, but related to performance: do not search DOM element frequently, save link to them and reuse variable.
var killsLabel = document.getElementById("killsText");
// when you need it
killsLabel.innerHTML = "Score: " + playerData.score;
- Create arrays with required size to prevent reallocation overhead
var visible = new Array(required_size);
- GC cleans temporary objects and time it need to clean them depends on their number, so you can use closure compiler to inline everything that can be inlined to decrease number of objects GC had to process.
- Create arrays with required size to prevent reallocation overhead
var visible = new Array(required_size);
GC cleans temporary objects and time it need to clean them depends on their number, so you can use closure compiler to inline everything that can be inlined to decrease number of objects GC had to process.
Not GC optimization, but related to performance: do not search DOM element frequently, save link to them and reuse variable.
var killsLabel = document.getElementById("killsText");
// when you need it
killsLabel.innerHTML = "Score: " + playerData.score;