From 05e249def46ebb28cbe7c1d9e91aeaa6a00902fc Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Fri, 11 Mar 2011 19:27:07 -0500 Subject: [PATCH] Added result explanations to method invocation performance tests --- test/perf/perf-class-invoke-method.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/perf/perf-class-invoke-method.js b/test/perf/perf-class-invoke-method.js index db994ee..bc8b5b8 100644 --- a/test/perf/perf-class-invoke-method.js +++ b/test/perf/perf-class-invoke-method.js @@ -1,8 +1,18 @@ /** * Tests amount of time taken to invoke Class methods * - * Results are assigned to a var to ensure V8 doesn't optimize the calls too - * much. + * The expected results are as follows: + * - Method invocations are expected to be slower than invoking a method on a + * conventional constructor instance. This is because of the method wrapper + * used by ease.js. + * - Public methods externally should be invoked very quickly. They are part + * of the class's prototype and therefore easily accessible. + * - Public methods /internally/ are likely to be invoked slightly more + * slowly. This is because it takes one extra step down the prototype chain + * to access them. The difference should be minute. + * - Protected and private methods internally should be accessed fairly + * quickly since, like public methods externally, they are first on the + * prototype chain. * * Copyright (C) 2010 Mike Gerwitz *