diff --git a/performance/test-perf.js b/performance/test-perf.js index 2ba9b622..89160a05 100644 --- a/performance/test-perf.js +++ b/performance/test-perf.js @@ -70,7 +70,7 @@ suite.on("complete", function() { suite.on("error", console.error.bind(console)) suite.add({ - name : "rerender without changes", + name : "rerender identical vnode", onStart : function() { this.vdom = m("div", {class: "foo bar", "data-foo": "bar", p: 2}, m("header", @@ -119,6 +119,53 @@ suite.add({ } }) +suite.add({ + name : "rerender same tree", + fn : function() { + m.render(scratch, m("div", {class: "foo bar", "data-foo": "bar", p: 2}, + m("header", + m("h1", {class: "asdf"}, "a ", "b", " c ", 0, " d"), + m("nav", + m("a", {href: "/foo"}, "Foo"), + m("a", {href: "/bar"}, "Bar") + ) + ), + m("main", + m("form", {onSubmit: function onSubmit() {}}, + m("input", {type: "checkbox", checked: true}), + m("input", {type: "checkbox", checked: false}), + m("fieldset", + m("label", + m("input", {type: "radio", checked: true}) + ), + m("label", + m("input", {type: "radio"}) + ) + ), + m("button-bar", + m("button", + {style: "width:10px; height:10px; border:1px solid #FFF;"}, + "Normal CSS" + ), + m("button", + {style: "top:0 ; right: 20"}, + "Poor CSS" + ), + m("button", + {style: "invalid-prop:1;padding:1px;font:12px/1.1 arial,sans-serif;", icon: true}, + "Poorer CSS" + ), + m("button", + {style: {margin: 0, padding: "10px", overflow: "visible"}}, + "Object CSS" + ) + ) + ) + ) + )) + } +}) + suite.add({ name : "construct large VDOM tree",