javascript (jquery) script perfomance synchronous vs asynchronous
<p>I have a javascript function that filter dom elements based on a input text changes, so:</p>

<pre><code>$(".input").keyup(function(e) {
    filter();
});

var cache = $(".dom");

var filter = function() {
     cache.each(function() {
         // if field contains some text show else hide
     }
};
</code></pre>

<p>My problem happens when there are many dom elements to filter, the whole pages gets inaccessible because of the <strong>synchronous processing (like the example above)</strong>. Im trying to come out with a solution that dont locks the entire page with synchronous processing.</p>

<p><strong>The problem is NOT related to the filter logic (it's completely trivial), it's NOT related to the jquery or javascript itslef, it's related to the synchronous processing and the quantity of dom elements.</strong></p>
