Object Creation vs. Referencing Cached Object

Instructions

  1. Click "Run Tests" once to perform the three function calls listed in the table.

  2. After carefully reviewing the results, click "Run Tests" a second time to observe a dramatic change in getTokenizedExps result.

  3. Reload the page and repeat steps one and two.

    function createTokenizedExps() { // no cache used
        var exp = null;
        
        for(var i = 0; i < 10000; i++)
            exp = new RegExp("(^|\\s)"+(i)+"($|\\s)");    
    }
    
    /** Initialize or finds (in cache) 10,000 regexes. 
     */
    function getTokenizedExps() {
        var exp = null;
        
        for(var i = 0; i < 10000; i++)
            exp = getTokenizedExp(i, "");
    }    
	
Object Type Time
    createTokenizedExps
-
    createTokenizedExps
-
    getTokenizedExps
-

Function createTokenizedExps does not use a cache. Does it perform faster in the second row than in does in the first row? If so, by how much? Can you explain this behavior?