Performance improvements
See original GitHub issueI’ve been doing some performance analysis with chrome dev tools because fps was pretty low for my usage.
- PUID is really inefficient as it gets called a lot and iterate over the whole array of particles. Replacing the array with a Map looks like a better idea
export default {
_id: 0,
_uids: new Map(), //maps objects to IDs
id: function (functionOrObject) {
if (this._uids.has(functionOrObject))
return this._uids.get(functionOrObject);
const nid = 'PUID_' + this._id++;
this._uids.set(functionOrObject, nid);
return nid;
}
};
- Setting rotation for Sprites in MeshRenderer consumes a lot of CPU for nothing… as rotating a Sprite has no effect (you need to rotate the material)
constructor(container, THREE) {
[...]
this._THREE = THREE;
}
[...]
onParticleUpdate(particle) {
if (particle.target) {
particle.target.position.copy(particle.position);
if (!(particle.target instanceof this._THREE.Sprite))
particle.target.rotation.set(
particle.rotation.x,
particle.rotation.y,
particle.rotation.z
);
this.scale(particle);
if (particle.useAlpha) {
particle.target.material.opacity = particle.alpha;
particle.target.material.transparent = true;
}
if (particle.useColor) {
particle.target.material.color.copy(particle.color);
}
}
}
(alternatively, could override the whole function in SpriteRenderer)
Could you fix these or do you need a PR @rohan-deshpande ?
Issue Analytics
- State:
- Created 4 years ago
- Comments:21
Top Results From Across the Web
Performance Improvements
Thanks for 58 great years! All stores are now CLOSED. FINAL LIQUIDATION Auction of inventory, memorabilia and fixtures will take place in late...
Read more >What is Performance Improvement? - BambooHR
Performance improvement is a strategy under the umbrella of performance management that helps employees achieve better performance and growth.
Read more >Performance improvement - Wikipedia
Performance improvement is measuring the output of a particular business process or procedure, then modifying the process or procedure to increase the ...
Read more >What Is Performance Improvement? - WalkMe
Performance improvement refers to the improvement of a business process, function, or procedure with the intention of improving overall outcomes ...
Read more >How to Establish a Performance Improvement Plan - SHRM
A performance improvement plan (PIP), also known as a performance action plan, is a tool to give an employee with performance deficiencies the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay yep, it’s an issue, I will track this in a new issue and mention you there @davidpox thanks for reporting
Hey all, I’m also testing the GPURenderer and the performance improvement is incredible. I’m having issues with rendering however, seems like depth-testing isn’t working.
System is created like so:
Let me know if you want the Json data too.