Evan You 11 лет назад
Родитель
Сommit
66b124b7ec
6 измененных файлов с 1339 добавлено и 1472 удалено
  1. 1 1
      component.json
  2. 1247 1469
      dist/vue.js
  3. 1 1
      dist/vue.min.js
  4. 1 1
      package.json
  5. 2 0
      perf/bench.html
  6. 87 0
      perf/bench.js

+ 1 - 1
component.json

@@ -1,6 +1,6 @@
 {
   "name": "vue",
-  "version": "0.12.0-rc2",
+  "version": "0.12.0",
   "main": "src/vue.js",
   "author": "Evan You <yyx990803@gmail.com>",
   "description": "Simple, Fast & Composable MVVM for building interative interfaces",

Разница между файлами не показана из-за своего большого размера
+ 1247 - 1469
dist/vue.js


Разница между файлами не показана из-за своего большого размера
+ 1 - 1
dist/vue.min.js


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "vue",
-  "version": "0.12.0-rc2",
+  "version": "0.12.0",
   "author": "Evan You <yyx990803@gmail.com>",
   "license": "MIT",
   "description": "Simple, Fast & Composable MVVM for building interative interfaces",

+ 2 - 0
perf/bench.html

@@ -0,0 +1,2 @@
+<script src="../dist/vue.js"></script>
+<script src="./bench.js"></script>

+ 87 - 0
perf/bench.js

@@ -0,0 +1,87 @@
+function bench (fn, n) {
+  var s = Date.now()
+  var vms = []
+  for (var i = 0; i < n; i++) {
+    vms.push(fn())
+  }
+  console.log(n + ' ' + fn.desciption + ': ' + (Date.now() - s) + 'ms')
+}
+
+function emptyInstance () {
+  return new Vue()
+}
+emptyInstance.desciption = 'empty instances'
+
+var options = {
+  template: '{{hi}}',
+  data: function () {
+    return {
+      hi: 'msg'
+    }
+  },
+  ready: function () {},
+  filters: {
+    that: function () {}
+  }
+}
+
+function instanceWithOption () {
+  return new Vue(options)
+}
+instanceWithOption.desciption = 'instance with options'
+
+var Test = Vue.extend(options)
+function extendedInstance () {
+  return new Test()
+}
+extendedInstance.desciption = 'extended instances'
+
+function extendedInstanceWithOptions () {
+  return new Test({
+    data: function () {
+      return {
+        b: 'lol'
+      }
+    },
+    ready: function () {},
+    directives: {
+      that: function () {
+        
+      }
+    }
+  })
+}
+extendedInstanceWithOptions.desciption = 'extended instances with options'
+
+bench(emptyInstance, 100)
+bench(emptyInstance, 1000)
+bench(emptyInstance, 10000)
+
+bench(instanceWithOption, 100)
+bench(instanceWithOption, 1000)
+bench(instanceWithOption, 10000)
+
+bench(extendedInstance, 100)
+bench(extendedInstance, 1000)
+bench(extendedInstance, 10000)
+
+bench(extendedInstanceWithOptions, 100)
+bench(extendedInstanceWithOptions, 1000)
+bench(extendedInstanceWithOptions, 10000)
+
+// TODO:
+//
+// - rendering performance
+//   - simple v-repeat
+//   - component v-repeat
+//   - v-repeat with nested components
+//
+// - data observation performance
+//   - simple objects
+//   - complex objects
+//   - small array
+//   - large array
+//
+// - dependency tracking performance
+//   - simple watcher
+//   - complex watcher

Некоторые файлы не были показаны из-за большого количества измененных файлов