@danielkalen/simplybind
Version:
Magically simple, framework-less one-way/two-way data binding for frontend/backend in ~5kb.
30 lines (23 loc) • 685 B
text/coffeescript
new TestSuite
'title': 'Div HTML 250 Placeholders'
'subtitle': 'Update 250 placeholders in the content of a div 1,000 times'
'measureMethod': 'sync'
'warmUps': 100
'timesToRun': 1000
'setupFn': (container$)->
@obj = 'prop':'value'
@div$ = $("<div>#{'{{value}} '.repeat(250)}</div>")
currentValue = 0
SimplyBind('prop').of(@obj)
.to('innerHTML.value').of(@div$)
@getNewValue = ()-> "value#{currentValue++}"
container$.append @div$
return
'teardownFn': (container$)->
container$.empty()
SimplyBind.unBindAll(@obj, true)
SimplyBind.unBindAll(@div$, true)
delete @obj
delete @div$
delete @getNewValue
'testFn': ()-> @obj.prop = @getNewValue()