knockout.js - knockout performance issue with updateValue: 'afterkeydown' -


i have searchbox , table showing 0 - 100 result rows:

<input type="text" data-bind="value: vm.query,                               valueupdate: 'afterkeydown',                               event: { keypress: vm.keypress} ">  <table>   <tbody data-bind="foreach: results">     <tr>       <td> <p data-bind="text: property1"></p> </td>       <td> <p data-bind="text: property2"></p> </td>       ... 

when have 10 rows in results table, ok performance when writing stuff in input-box. yellow = javascript touching 16 ms limit not more: chrome timeline 1

when have 100 rows in results table, performance horrible when writing stuff in input-box. yellow = javascript through roof: chrome timeline 2

if remove valueupdate: 'afterkeydown' there no performance problems have because when user presses enter i'm firing of search using event: { keypress: vm.keypress}.

is there performance gotcha valueupdate: 'afterkeydown' or performance problem more due else in code?

you can use "throttle" extender asynchronously reevaluate table.
details here.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -