Closed andershol closed 5 years ago
Thanks for your report. I hadn't noticed the performance penalty before.
Several observations:
onclick
, onfocus
, oninput
and onblur
. The only way to reduce this is to use Text Field's ignoreEvents
option, but the practicability of this will be small.setState
). I will add this check for Mithril.I only noticed this after I tried using real data for something I did a while ago, so I was also surprised (especially that it was so non-linear -- going from 5 to 10 items per row). It sound like the changes you are planning will also help make normal pages a little faster and not just this kind of contrived huge page, so that is good. I assume Mithril will only call redraw for events that have been subscribed to, so if polythene did more of its styling updates with css, maybe it could avoid subscribing to the events. And of course, thanks a lot for all your work on this project.
I assume Mithril will only call redraw for events that have been subscribed to
You can see progress in this flems.
Okay, it was just an idea, and it is probably not that important as human-generated events are often far apart (several ms). But I don't think I understand the link to say that it will redraw for event handlers that are not used, and a little test also seems to say that it isn't so.
You can see progress in this flems.
Very nice. 👍
If you have many fields on a page the will redraw many times. For example this simple test with 100 rows each with 10 text fields will redraw 3001 times in both Firefox and Chrome which could take minutes: https://jsbin.com/jivezitaku/edit?html,output