perf: optimize canvas rendering and reduce CPU usage#5161
perf: optimize canvas rendering and reduce CPU usage#5161walterbender merged 1 commit intosugarlabs:masterfrom
Conversation
|
✅ All Jest tests passed! This PR is ready to merge. |
3 similar comments
|
✅ All Jest tests passed! This PR is ready to merge. |
|
✅ All Jest tests passed! This PR is ready to merge. |
|
✅ All Jest tests passed! This PR is ready to merge. |
3a8ac02 to
64a25e6
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
|
Please resolve the conflict in js/activity. Also, is this redundant in light of #5091 Also, why are there changes to index.html here? |
index.html change removes duplicate Ticker that was causing 120fps instead of 60fps |
64a25e6 to
cc5cea8
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
cc5cea8 to
7634935
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
7634935 to
6cd4c47
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
6cd4c47 to
4d692ef
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
4d692ef to
32740be
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
Summary
This PR optimizes the rendering pipeline to significantly improve Music Blocks performance, especially during idle states and project loading.
Changes Made
1. Optimized refreshCanvas() method (js/activity.js)
setTimeoutwithrequestAnimationFramefor browser-optimized renderingstage.clear()callstage.update()calls that were causing unnecessary repaints_pendingRefreshflag2. Smart Ticker Optimization (js/activity.js)
if (this.update || createjs.Tween.hasActiveTweens())3. Removed Duplicate Ticker (index.html)
createjs.Ticker.addEventListener("tick", stage)that was causing double rendering4. Faster Turtle Initialization (js/turtles.js)
setTimeoutdelay withrequestAnimationFramePerformance Improvements
Expected Impact
Testing