bem / bem-xjst

bem-xjst (eXtensible JavaScript Templates): declarative template engine for the browser and server
https://bem.github.io/bem-xjst
Other
116 stars 48 forks source link

Benchmark and test on bem-components #32

Closed indutny closed 9 years ago

indutny commented 9 years ago

n/t

indutny commented 9 years ago

showcase done: https://gist.github.com/indutny/d4b83e1bc5277bbffcd8

Results:

compile: 26ms
warmed up next
warmed up prev
next: 2294.6305644791187 RPS
prev: 1578.0337699226764 RPS

Looking good so far.

indutny commented 9 years ago

Other pages should be tested too.

indutny commented 9 years ago

Oh, also. There are some differences between next.bemhtml and prev.bemhtml at the moment.

Summary of them:

indutny commented 9 years ago

Benchmark of bem-components/desktop.pages/index : https://gist.github.com/indutny/32d3206017302d306fab

Results:

compile: 27ms
warmed up next
warmed up prev
next: 1152.3392486748098 RPS
prev: 659.3696426216537 RPS

Fantastic!

indutny commented 9 years ago

Here are the timings for blown-up (16x times bigger content of bem-components/desktop.pages/index):

compile: 26ms
warmed up next
warmed up prev
next: 61.82380216383308 RPS ~ 16.175 ms
prev: 30.83279375944254 RPS ~ 32.433 ms

cc @veged

narqo commented 9 years ago

@indutny can you add info about the version of node.js / io.js that you'd been tested with.

We've made a small research about the speed of current version of bem-xjst / bh and it turned out, that the results differ greatly (up to 150%) if we measure the same templates on 0.10/0.12 and io.js1.8

indutny commented 9 years ago

@narqo looks similar:

node.js v0.10.36:

compile: 7ms
warmed up next
warmed up prev
next: 51.698288786641164 RPS ~ 19.343 ms
prev: 32.18124477054773 RPS ~ 31.074 ms

io.js v2.0.0:

compile: 27ms
warmed up next
warmed up prev
next: 51.27416294928985 RPS ~ 19.503 ms
prev: 31.30576339104029 RPS ~ 31.943 ms
narqo commented 9 years ago

Hm, here is your gist (but with next=false) run on my machine:

varmbp £ ~/W/test-templates1 ⤳  master ±
  › node bench.js    # node v0.12.2
warmed up prev
prev: 253.83287643415576 RPS

varmbp £ ~/W/test-templates1 ⤳  master ±
  › iojs bench.js     # iojs v1.8.1
warmed up prev
prev: 422.3864836325238 RPS

Anyway, jfi