From 94d186b09564f6736a8e6dbabf299dfc04b95115 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 16 May 2016 18:26:25 -0400 Subject: [PATCH] update ssr benchmark --- benchmarks/ssr/README.md | 6 +++--- benchmarks/ssr/common.js | 28 +++++++++++----------------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/benchmarks/ssr/README.md b/benchmarks/ssr/README.md index 3e1c02a3..1058bcb2 100644 --- a/benchmarks/ssr/README.md +++ b/benchmarks/ssr/README.md @@ -1,10 +1,10 @@ # Vue.js SSR benchmark -This benchmark renders a table of 1000 rows with 10 columns (10 thousand components). This benchmark is to demonstrate the overall speeds of Vue.js SSR and time to content comparison between `renderToString` and `renderToStream`. +This benchmark renders a table of 1000 rows with 10 columns (10k components), with around 30k normal elements on the page. Note this is not something likely to be seen in a typical app. This benchmark is mostly for stress/regression testing and comparing between `renderToString` and `renderToStream`. -To view the results follow the run section. Note that the overall completion time for the results are variable, this is due to other system related variants at run time (available memory, processing ect). In ideal circumstances both should finish within equal times. +To view the results follow the run section. Note that the overall completion time for the results are variable, this is due to other system related variants at run time (available memory, processing ect). In ideal circumstances both should finish within similar results. -`renderToStream` pipes the content through a stream which gives massive performance benefits over renderToString. This can be observed through the benchmark. +`renderToStream` pipes the content through a stream which provides considerable performance benefits (faster time-to-first-byte and non-event-loop-blocking) over renderToString. This can be observed through the benchmark. ### run diff --git a/benchmarks/ssr/common.js b/benchmarks/ssr/common.js index 210b6be2..ba13d4b2 100644 --- a/benchmarks/ssr/common.js +++ b/benchmarks/ssr/common.js @@ -26,20 +26,8 @@ function generateGrid (rowCount, columnCount) { const gridData = generateGrid(1000, 10) -var perfMixin = { - computed: { - performance: { - cached: false, - get: function () { - return (self.performance.now() - self.s).toFixed(2) - } - } - } -} - var gridComponent = { - template: '

{{ performance }}ms

', - mixins: [perfMixin], + template: '

{{ Math.random() }}

', components: { myTable: { data: function () { @@ -47,16 +35,22 @@ var gridComponent = { grid: gridData } }, + // template: '
123{{ item.id }}
', template: '
', components: { row: { props: ['row'], - mixins: [perfMixin], - template: '{{ performance }}ms', + template: '{{ Math.random() }}', components: { column: { - mixins: [perfMixin], - template: '{{ performance }}ms' + template: '' + + // 25 plain elements for each cell + '' + + '' } } }