On 07/08/2014 12:20 PM, Rob Lanphier wrote:
> On Tue, Jul 8, 2014 at 10:27 AM, Jon Robson <[email protected]> wrote:
> 
>> In terms of benchmarks, I was thinking more along the lines of
>> benchmarking on the client, in particular for mobile devices which may
>> have less memory. This would essentially be, time to load the template
>> from the server to the time taken to render.
> 
> 
> Is there someone who has the time to perform and publish an independent
> audit on performance specifically?  We currently have this:
> https://www.mediawiki.org/wiki/Requests_for_comment/HTML_templating_library#Performance
> 
> ...which suggests that Knockoff is 50% faster than then next fastest
> solution (Handlebars), and over 10x faster than most.  If this stands up to
> scrutiny, and holds true as Knockoff gains feature parity, this is a huge
> achievement that we should shout about far and wide, since I believe no one
> disputes that a DOM-based approach is much more secure than a string-based
> approach.  Before bragging about this, though, we should make absolutely
> sure that it stands up to independent scrutiny.

The JS implementation is around 50% faster in some micro benchmarks, and
about even with handlebars in others. The benchmark code is all on github
[1], so please study, run & improve it.

I'm currently re-running the benchmarks using the latest code on ruthenium
(checkout in /home/gwicke/TemplatePerf). Here are the first results:

Set: Knockoff (node.js) (knockoff-node)
Test: test1 [050] Avg: 0.0815 Min: 0.0530 Max: 0.1050
Test: test1b [050] Avg: 0.1334 Min: 0.0760 Max: 0.1510
Test: test2 [050] Avg: 0.8882 Min: 0.6440 Max: 1.1260
Test: test2 lambda [050] Avg: 0.6492 Min: 0.4730 Max: 0.7880
Test: test3 [050] Avg: 0.3166 Min: 0.1960 Max: 0.5110
Set: Handlebars (node.js) (handlebars-node)
Test: test1 [050] Avg: 0.2093 Min: 0.1270 Max: 0.2750
Test: test1b [050] Avg: 0.2911 Min: 0.1660 Max: 0.3850
Test: test2 [050] Avg: 0.8271 Min: 0.6050 Max: 1.0400
Test: test2 lambda [050] Avg: 1.4567 Min: 1.1430 Max: 2.0150
Test: test3 [050] Avg: 0.2920 Min: 0.1870 Max: 0.3680

So it looks like a slight slow-down in knockoff compared to the last run.
Which makes sense, as these tests include the compilation to a JSON template
in the benchmark, and the compiler has gained some features.

It would also be great if somebody could run the benchmarks with the very
latest HHVM nightly. Ruthenium is still on precise, which misses some boost
dependencies needed for the latest version. The version installed on
ruthenium is from January.

Gabriel

[1] https://github.com/gwicke/TemplatePerf

_______________________________________________
Wikitech-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to