Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- some progress

  • Loading branch information...
commit 28528ff9e0d1a63de1b85a1daa673a241cde2d9b 1 parent 46afa17
@SamuraiJack SamuraiJack authored
View
4 Changes
@@ -5,11 +5,11 @@ Release history for Joose:
[ENHANCEMENTS]
- detect when a class (a function like: `func.meta.c == func`) has been provided as `init` value for the attribute
- and do not call it during initialization
+ and do not call it during initialization (use as "value")
[API CHANGES]
- - removed the undocumented namespaces facility (was not in use anyway)
+ - removed the undocumented namespaces facility (not documented, low-level stuff)
[BUG FIXES]
View
113 bench/010_basic.js
@@ -1,7 +1,7 @@
StartBenchmark(
{
- title : 'Simple class creation time',
- id : 'class-creation-simple',
+ title : 'Small class creation time',
+ id : 'class-creation-simple1',
run : function () {
return Class({
@@ -9,41 +9,106 @@ StartBenchmark(
has : {
foo : Joose.I.Array,
bar : Joose.I.Object
+
},
methods : {
-
doThis : function () {},
doThat : function () {}
}
})
}
-
},
{
- title : 'Class instantiation time',
- id : 'class-instantiation-simple',
+ title : 'Average class creation time',
+ id : 'class-creation-simple2',
- prepare : function () {
- return {
- cls : Class({
-
- has : {
- foo : Joose.I.Array,
- bar : Joose.I.Object
- },
+ run : function () {
+ return Class({
+
+ has : {
+ foo : Joose.I.Array,
+ bar : Joose.I.Object,
+ foo1 : Joose.I.Array,
+ bar1 : Joose.I.Object,
+ foo2 : Joose.I.Array,
+ bar2 : Joose.I.Object,
+ foo3 : Joose.I.Array,
+ bar3 : Joose.I.Object,
+ foo4 : Joose.I.Array,
+ bar4 : Joose.I.Object
- methods : {
-
- doThis : function () {},
- doThat : function () {}
- }
- })
- }
- },
+ },
+
+ methods : {
+ doThis : function () {},
+ doThat : function () {},
+ doThis1 : function () {},
+ doThat1 : function () {},
+ doThis2 : function () {},
+ doThat2 : function () {},
+ doThis3 : function () {},
+ doThat3 : function () {},
+ doThis4 : function () {},
+ doThat4 : function () {}
+ }
+ })
+ }
+ },
+ {
+ title : 'Big class creation time',
+ id : 'class-creation-simple3',
- run : function (measurement, prepared) {
- return new prepared.cls()
+ run : function () {
+ return Class({
+
+ has : {
+ foo : Joose.I.Array,
+ bar : Joose.I.Object,
+ foo1 : Joose.I.Array,
+ bar1 : Joose.I.Object,
+ foo2 : Joose.I.Array,
+ bar2 : Joose.I.Object,
+ foo3 : Joose.I.Array,
+ bar3 : Joose.I.Object,
+ foo4 : Joose.I.Array,
+ bar4 : Joose.I.Object,
+ foo5 : Joose.I.Array,
+ bar6 : Joose.I.Object,
+ foo10 : Joose.I.Array,
+ bar10 : Joose.I.Object,
+ foo20 : Joose.I.Array,
+ bar20 : Joose.I.Object,
+ foo30 : Joose.I.Array,
+ bar30 : Joose.I.Object,
+ foo40 : Joose.I.Array,
+ bar40 : Joose.I.Object
+ },
+
+ methods : {
+ doThis : function () {},
+ doThat : function () {},
+ doThis1 : function () {},
+ doThat1 : function () {},
+ doThis2 : function () {},
+ doThat2 : function () {},
+ doThis3 : function () {},
+ doThat3 : function () {},
+ doThis4 : function () {},
+ doThat4 : function () {},
+ doThis5 : function () {},
+ doThat5 : function () {},
+ doThis10 : function () {},
+ doThat10 : function () {},
+ doThis20 : function () {},
+ doThat20 : function () {},
+ doThis30 : function () {},
+ doThat30 : function () {},
+ doThis40 : function () {},
+ doThat40 : function () {}
+ }
+ })
}
}
+
)
View
34 bench/020_basic.js
@@ -0,0 +1,34 @@
+StartBenchmark(
+ {
+ title : 'ExtJS class creation time',
+ id : 'ext-class-creation-simple',
+
+ run : function () {
+ return Ext.define('Class' + Math.round(Math.random() * 1e10), {
+
+ foo : null,
+ bar : null,
+ foo1 : null,
+ bar1 : null,
+ foo2 : null,
+ bar2 : null,
+ foo3 : null,
+ bar3 : null,
+ foo4 : null,
+ bar4 : null,
+
+ doThis : function () {},
+ doThat : function () {},
+ doThis1 : function () {},
+ doThat1 : function () {},
+ doThis2 : function () {},
+ doThat2 : function () {},
+ doThis3 : function () {},
+ doThat3 : function () {},
+ doThis4 : function () {},
+ doThat4 : function () {}
+ })
+ }
+
+ }
+)
View
49 bench/030_basic.js
@@ -0,0 +1,49 @@
+var original = function (a) {
+ return a + 'a'
+}
+
+var inside = function() {
+ return arguments.callee.caller
+}
+
+
+var wrapper = function() {
+ return inside.call(this)
+}
+
+
+var modifier = function() {}
+
+var override = function() {
+
+ var beforeSUPER = this.SUPER
+
+ this.SUPER = original
+
+ var res = modifier.apply(this, arguments)
+
+ this.SUPER = beforeSUPER
+
+ return res
+}
+
+
+StartBenchmark(
+ {
+ id : 'Wrap1',
+
+ run : function (bench, prepared) {
+ override.call({})
+ }
+ },
+
+
+ {
+ id : 'Wrap2',
+
+ run : function (bench, prepared) {
+ prepared.call({})
+ }
+ }
+)
+
View
9 bench/index.js
@@ -21,6 +21,13 @@ Harness.configure({
Harness.start(
- '010_basic.js'
+ '010_basic.js',
+ {
+ url : '020_basic.js',
+
+ preload : [ '../../ext-4.0.2a/ext-all.js' ]
+ }
+// ,
+// '030_basic.js'
)
Please sign in to comment.
Something went wrong with that request. Please try again.