msx icon indicating copy to clipboard operation
msx copied to clipboard

Optimizing use of the cache

Open Satyam opened this issue 9 years ago • 1 comments

Mithirl caches nodes created via the m() function, indexed by its first argument.

This is an example of a node that caches well:

m('a#google.external[href="http://google.com"]", 'Google'); 

If all those attributes, class, id and href were not part of the first argument, only an empty a node would be cached and the rest of the attributes would have to be assembled one by one, every time that the view is called.

MSX should be able to distinguish attributes that are constant:

<div class="panel-heading">

from those that are variable, that is, that get their value from an expression:

<span class={g.disabled()?'text-muted':''}>

The first should result in:

m('div.panel-heading')

The second in:

m('span',{class:g.disabled()?'text-muted':''})

This would greatly speed up the refresh process.

Satyam avatar Jul 12 '14 16:07 Satyam

Am I right to assume that the pull request for #1 obviates the need for this?

insin avatar Jan 23 '15 22:01 insin