Comments (6)
I look forward to those speed increases!
You'll be happy to hear the Stroke class has a new addBreak() function! It works like so
for(i=0; i<10; i++) {
stroke.addVertex(0, i*10, 1);
stroke.addVertex(100, i*10, 1);
stroke.addBreak()
}
A load of other optimisations centered around the Stroke class have also gone in. You can see the changes here.
f95fc86
I'd be interested to hear what sort of impact this has on mobile.
from starling-extension-graphics.
I forgot to mention. If you're compiling your own SWC, include the -inline compiler option to get an small additional boost.
from starling-extension-graphics.
As usual, highly impressed by your commitment! Thank you very much Jonathan!
Funny, inlining was one of the small bits that I was going to commit as well, guess that's already been done. 👍
from starling-extension-graphics.
Did a little testing with the latest code. Naturally, the addBreak() added a huge performance gain over using a separate Stroke for each line or moveTo/lineTo (about 25%).
I'm afraid I can't say anything about your other code changes. From looking at the code, I have no doubts that the code is faster, though I can't say by how much as my usage of your library is still limited to drawing Strokes and Fills and for those I couldn't notice a performance gain. That being said, my performance test is far from ideal or even widely usable to the graphics api as it just analyses how much time it takes to redraw our chart in one frame, and since we're down to 14ms per frame already, it is hard to even measure gains that are smaller than 10%.
However, I'm thinking of writing a little test app in my free time that make a more thorough analysis of the API's performance on mobile devices.
from starling-extension-graphics.
Thanks for the breakdown. The per-frame changes were pretty minor. I was seeing savings on desktop of ~5% when processing a huge amount of strokes. I've just committed another small optmisation, saving another ~3%.
Also nestled in there are some optimisations targeting GC - so while it won't improve your frame-rate, it'll stop the GC kicking in as much when churning over a lot of Strokes.
from starling-extension-graphics.
That sounds great. An 8% gain is huge, especially on mobile. We're rapidly adding features to our chart engine and I'm absolutely positive that these 8% will make a difference very soon, so I can't thank you enough for your efforts!
from starling-extension-graphics.
Related Issues (20)
- graphicsEx.graphics.postProcess() works strange HOT 2
- when draw line and change thickness stroke incorrect HOT 1
- Why it doesn't use ddx/ddy oppcodes for curve drawing? HOT 1
- Stage resize - null material HOT 2
- TypeError: Error #1034 HOT 3
- Width returns 0 HOT 4
- Shapes cannot be touched HOT 1
- Texture no repeat in TextureVertexColorFragmentShader HOT 8
- Texture restoration after context loss HOT 3
- Duplicate variable definition of function paramters HOT 5
- extra comma in TextureMaterial class HOT 1
- graphics.moveTo doesn't work in this situation HOT 3
- Starling 2 HOT 46
- Add and update dependency version HOT 1
- Context loss SEG not recovering - No valid program set. HOT 5
- starling.core.RenderSupport problem with Starling 2 HOT 4
- Readme needs more detail
- Error #3600: No valid program set. HOT 3
- Stroke Problem
- Is TextureFill supported with starling 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starling-extension-graphics.