performance of hanzi-writer
See original GitHub issueI’m testing hanzi-writer on mobile platform, and with large displays I have real issue with general performance of animations (probably below 10fps) and it is really ugly (I’m on a google galaxy note 4 with a Android 4.4). Inkstone is based on the same data and same langage and technique here (javascript in webview and tween, the only difference is that they use Cordova, but to my limited knowledge, it shouldn’t have any impact) and achieve much better on the same terminals.
I’m still quite new to all this, and I suspect that Inkstone is actually upscaling the resolution rather than drawing more pixel precise animation. I’ll post updates if I have time about this topic here for any person finding Hanzi-Writer a little slow and possible technical solutions. Any thoughts on that subject are welcome.
One question I had related to that is : are the CSS animation faster than the javascript ones ? (I’d guess so), and if so, it seems that some actions can be transfered to CSS animation (using transition
and keyframes …).
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (13 by maintainers)
It probably makes sense to polish the canvas PR and allow it to be enabled as a config option, something like
{ renderer: 'canvas' }
. I’m worried about switching over fully since there are likely users relying on CSS to style the SVG output like in https://github.com/chanind/hanzi-writer/issues/87. I’ll put together a PR adding the canvas renderer as a config option.Great! Thank you!
I just found a bug on the Canvas version.
When you change the ideogram, it doesn’t clean the previous ideogram loaded:
https://youtu.be/LYp-1yzM3Ms
To change, i’m using the setCharacter method.
That does’t happen on the SVG version.