zordius/lightncandy — pull request #11 by zordius (2014-03-04 03:59:35+00:00)
Title: Performance compilevar

Big performance improvement by moving variable naming resolver from render() to compile() .

Tested by https://github.com/zordius/HandlebarsTest .

* Test 1: **22.4% BOOSTED**
* NEW: Render 100005 times with lightncandy lib takes 232.48420214653 seconds
{"lib":"lightncandy","test":"fixture\/019-hb-eachparent-001.json","loop":"100005","time":232.48420214653,"match":"YES"}
* OLD: Render 100005 times with lightncandy lib takes 284.78881192207 seconds
{"lib":"lightncandy","test":"fixture\/019-hb-eachparent-001.json","loop":"100005","time":284.78881192207,"match":"YES"}

* Test 2: **15.7% BOOSTED**
* NEW: Render 1005 times with lightncandy lib takes 89.05255317688 seconds
{"lib":"lightncandy","test":"fixture\/livetest-001-hb-001.json","loop":"1005","time":89.05255317688,"match":"YES"}
* OLD: Render 1005 times with lightncandy lib takes 103.12785887718 seconds
{"lib":"lightncandy","test":"fixture\/livetest-001-hb-001.json","loop":"1005","time":103.12785887718,"match":"YES"}

* Test 3: **29.9% BOOSTED**
* NEW: Render 10005 times with lightncandy lib takes 53.17470908165 seconds
{"lib":"lightncandy","test":"fixture\/021-hb-manyparent-003.json","loop":"10005","time":53.17470908165,"match":"YES"}
* OLD: Render 10005 times with lightncandy lib takes 69.095240116119 seconds
{"lib":"lightncandy","test":"fixture\/021-hb-manyparent-003.json","loop":"10005","time":69.095240116119,"match":"YES"}

The more {{../../...}} , the faster in this branch.
The longger {{a.b.c.d...}} , the faster in this branch.