Test name | Executions per second |
---|---|
Trust existing | 9.9 Ops/sec |
Trust new | 10.2 Ops/sec |
function Vnode(tag, key, attrs0, children0, text, dom) {
return {tag: tag, key: key, attrs: attrs0, children: children0, text: text, dom: dom, domSize: undefined, state: undefined, events: undefined, instance: undefined}
}
function trust( html ) {
if( html == null ) html = "";
return Vnode("<", undefined, undefined, html, undefined, undefined)
}
for( var i = 0; i < 100000; i++) {
if( i < 50000 ) trust( null );
else trust( 'test' );
}
function trust( html ) {
return Vnode("<", undefined, undefined, html || "", undefined, undefined)
}
for( var i = 0; i < 100000; i++) {
if( i < 50000 ) trust( null );
else trust( 'test' );
}