-
Notifications
You must be signed in to change notification settings - Fork 28
Benchmarks
The Blade parser/compiler is a bit slow. That's probably okay because Blade makes it easy to
cache compiled views. If you use Blade with Express, for example, Express will automatically
cache compiled views when running with NODE_ENV === "production"
.
The most crucial part of Blade's performance lies with the performance of compiled templates and the performance of the Blade runtime. I'm pleased to say that the runtime is pretty darn fast. On my computer, I can render a reasonably complex template with file includes in less than 1ms. This test was performed on Google Chrome v18 on Windows 7 on a two-year-old laptop (i7 processor). I got around 12,000 renders per second.
- Minified template render time: ~10,000 - 14,000 renders per second (pretty darn good)
- Minified template compile time (no caching): ~350 - 400 small templates per second. This is around 4,000 lines of Blade per second... like I said, quite slow.
- Minified template compile time (with caching) ~100,000+ templates per second (yay caching!)
You can test the performance of Blade on your machine by running the test/benchmark.js file.
Blade performance:
------------------
Blade test suite statistics:
Files: 24
Total number of lines: 303
Parse the entire test suite 40 times: 1572ms
Compile (cache off, minify on) the entire test suite 40 times: 2583ms
Render (cache off, minify on) the entire test suite 40 times: 3212ms
Compile and cache the entire test suite 1 times: 72ms
Compile (cache on, minify on) the entire test suite 1000 times: 220ms
Render (cache on, minify on) the entire test suite 1000 times: 1963ms