Posts

Showing posts with the label test

Javascript for() loop vs jQuery .each() performance comparison

This post is an outcome of 15 minutes of free time and a question that I had yesterday. This question were: How fast jQuery’s .each() method is? How does it compare to javascript’s native for loop? It is clear without any performance tests that native javascript for loop is faster, but I always used jQuery’s .each() utility with caution. It always felt like I will get a performance

Javascript for() loop vs jQuery .each() performance comparison

This post is an outcome of 15 minutes of free time and a question that I had yesterday. This question were: How fast jQuery’s .each() method is? How does it compare to javascript’s native for loop? It is clear without any performance tests that native javascript for loop is faster, but I always used jQuery’s .each() utility with caution. It always felt like I will get a performance

Check if jQuery.js is loaded

This is the very basics of any programming language, checking if some class, method, variable or property does already exist. In our case the programming environment is JavaScript and the object we are checking for existence is jQuery() / $() function. This method is not limited to jQuery only, you can check for any other variable or function in your javascript. Anyway, jQuery() or $()

Check if jQuery.js is loaded

This is the very basics of any programming language, checking if some class, method, variable or property does already exist. In our case the programming environment is JavaScript and the object we are checking for existence is jQuery() / $() function. This method is not limited to jQuery only, you can check for any other variable or function in your javascript. Anyway, jQuery() or $()

jQuery 1.2.6 and jQuery 1.3 class selector performance benchmark

Reading about the jQuery 1.3's new selector engine Sizzle and its speed improvements I thought I would do a performance comparison between jQuery 1.2.6 and jQuery 1.3. I was prepared for something good, but the test results blew my mind. I had a page with one unordered list with 1000 items each with a class (class="1", class="2", etc). Here is  are the tests and results: console.time("

jQuery 1.2.6 and jQuery 1.3 class selector performance benchmark

Reading about the jQuery 1.3's new selector engine Sizzle and its speed improvements I thought I would do a performance comparison between jQuery 1.2.6 and jQuery 1.3. I was prepared for something good, but the test results blew my mind. I had a page with one unordered list with 1000 items each with a class (class="1", class="2", etc). Here is  are the tests and results: console.time("

How to check your JavaScript code for errors

There are times when you can't understand why your code is not doing what it's supposed to do. After killing half an hour on trying to figure out what is the problem you either give up and decide to rewrite or leave it for later. Later looking at your code you clearly see the bug and think how you couldn't you see it. For cases like that you can use online JavaScript code validator JSLint.

How to check your JavaScript code for errors

There are times when you can't understand why your code is not doing what it's supposed to do. After killing half an hour on trying to figure out what is the problem you either give up and decide to rewrite or leave it for later. Later looking at your code you clearly see the bug and think how you couldn't you see it. For cases like that you can use online JavaScript code validator JSLint.

How to test JavaScript code performance

Sometimes after all day long coding your code becomes not so effective and your code (usually interface related) becomes slow. You have done so many changes and don't exactly know what slowing it down. In cases like this (and of course, plenty other cases) you can test your JavaScript code performance.  First of all, you need Firefox browser and Firebug web developers life saver plugin. I can not

How to test JavaScript code performance

Sometimes after all day long coding your code becomes not so effective and your code (usually interface related) becomes slow. You have done so many changes and don't exactly know what slowing it down. In cases like this (and of course, plenty other cases) you can test your JavaScript code performance.  First of all, you need Firefox browser and Firebug web developers life saver plugin. I can not