Sugartags waste Mithril's tag cache
Satyam opened this issue · 2 comments
Satyam commented
Mithril keeps a cache of created nodes indexed by the first argument to the m
method. The more constant attributes you can pile up in the first argument, the best.
This: m('.item')
is best than m('div', {class:'item'})
because in the first case Mithirl will clone a div
node with the class
attribute already set while in the second it will clone a generic div
and then waste time adding the class
attribute.
jsguy commented
Hmmm interesting - I'll see if I can optimise on that, thanks! 👍
jsguy commented
I've added a task for this in the sugartags project:
So I'll close this for now.