-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce garbage collection frequency #71
Comments
FPS works nice, but memory can be optimized via reducing objects count and prepare shape before starting tweeen |
Yes FPS seems okay on my macbook pro, but this simple example seems janky. It's potentially being garbage collected too regularly (9 times in 6 seconds?). |
Creating less objects, array slightly improves performance. Reusing arrays and objects, caching gives even better results |
I've made some good initial progress on reducing objects. Garbage collection frequency has halved in my tests. There's still plenty more to do in core. One area specifically to improve is middleware. Currently every tweened value is output through every piece of enabled middleware. This is unnecessary. I will think of a better way to do this. |
Another area to refactor is the event system. Even if there are no event subscriptions Wilderness calls events function on each tick of a timeline. This creates a couple of new objects. I'm thinking of changing the API here so that event subscription can only happen at timeline creation. const timelineFinishCallback = () => alert('timeline finished')
const shapeStartCallback = shapeName => {
if (shapeName === 'SHAPE_1') {
alert('shape 1 started')
}
}
timeline(shape1, shape2, {
events: [
[ 'timeline.finish', timelineFinishCallback ],
[ 'shape.start', shapeStartCallback ]
]
}) This way for timelines with no events (I assume this will be the majority), there will be zero overhead from the event system. |
The GSAP cannot be compared to this as this is free and available for anyone. That is matter for a lot of developers, newbies and others. Wilderness is free and enough fast to made smooth UI with morph. Maybe i wrong... Check out this https://www.npmjs.com/package/es6tween-plugin-morph maybe this is comparable because its free and based on points and svgpoints with some helpers. Also i build some morph that does from group to path or etc or vice versa. The es6tween morph plugin also not bad. Does group to group and path to any except group and so on. |
About performance the last commits looks nice. |
change event api from pubsub to defined at timeline creation. BREAKING CHANGE: Timeline event API change. See d11b036c635f33966f1a816b303ec128e88ae673. Also, exports flushEvents function in place of events function. Refs colinmeinke/wilderness#71
How is Wilderness handling memory? FPS? What are the bottlenecks? What improvements can be made?
The text was updated successfully, but these errors were encountered: