From 7a82b6442302ae9addbe108061531c9ce64ac2a2 Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 18 May 2017 13:51:16 +0800 Subject: [PATCH] revert to original bench code --- benchmarks/ssr/common.js | 55 +++++++--------------------------------- 1 file changed, 9 insertions(+), 46 deletions(-) diff --git a/benchmarks/ssr/common.js b/benchmarks/ssr/common.js index 9711a520..4ce56fb0 100644 --- a/benchmarks/ssr/common.js +++ b/benchmarks/ssr/common.js @@ -25,8 +25,6 @@ function generateGrid (rowCount, columnCount) { const gridData = generateGrid(1000, 10) -const five = [0, 1, 2, 3, 4] - module.exports = { template: '

{{ Math.random() }}

', components: { @@ -41,34 +39,17 @@ module.exports = { components: { row: { props: ['row'], - // template: '{{ Math.random() }}', - render (h) { - return h('tr', [ - new TextNode(1, [ - new TextNode(2), - ...this.row.items.map(item => h('column')) - ]) - ]) - }, + template: '{{ Math.random() }}', components: { column: { - render (h) { - return h('td', { class: 'item' }, [ - new TextNode(4, - five.map(() => new TextNode(5, - five.map(() => new TextNode(6, [new TextNode(7)]))) - ) - ) - ]) - } - // template: '' + - // // 25 plain elements for each cell - // '' + - // '' + template: '' + + // 25 plain elements for each cell + '' + + '' } } } @@ -76,21 +57,3 @@ module.exports = { } } } - -const renderFns = [ - { open: () => ``, close: `` }, - { open: () => ``, close: `` }, - { open: () => Math.random() }, - { open: () => ``, close: `` }, - { open: () => `` }, - { open: () => `
  • `, close: `
  • ` }, - { open: () => ``, close: `` }, - { open: () => `fsefs` } -] - -function TextNode (id, children) { - this.isTextNode = true - this.open = renderFns[id].open - this.close = renderFns[id].close - this.children = children -}