Criteo code (v2)

Revision 2 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Criteo default
   document.MAX_ct0 ='';
   var m3_u = (location.protocol=='https:'?'https://cas.criteo.com/delivery/ajs.php?':'http://cas.criteo.com/delivery/ajs.php?');
   var m3_r = Math.floor(Math.random()*99999999999);
   document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
   document.write ("zoneid=112450");document.write("&amp;nodis=1");
   document.write ('&amp;cb=' + m3_r);
   if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
   document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
   document.write ("&amp;loc=" + escape(window.location));
   if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
   if (document.context) document.write ("&context=" + escape(document.context));
   if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {
       document.write ("&amp;ct0=" + escape(document.MAX_ct0));
   }
   if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
   document.write ("'></scr"+"ipt>");
 
ready
My code
   document.MAX_ct0 ='';
   var m3_u = 'http://cas.criteo.com/delivery/ajs.php?';
   var m3_r = Math.floor(Math.random()*99999999999);
   var src = [];
   src.push(m3_u);
   src.push("zoneid=112450");
   src.push("&amp;nodis=1");
   src.push ('&amp;cb=' + m3_r);
   if (document.MAX_used != ',') src.push ("&amp;exclude=" + document.MAX_used);
   src.push (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
   src.push ("&amp;loc=" + escape(window.location));
   if (document.referrer) src.push ("&amp;referer=" + escape(document.referrer));
   if (document.context) src.push ("&context=" + escape(document.context));
   if ((typeof(document.MAX_ct0) != 'undefined') && (document.MAX_ct0.substring(0,4) == 'http')) {
       src.push ("&amp;ct0=" + escape(document.MAX_ct0));
   }
   if (document.mmm_fo) src.push ("&amp;mmm_fo=1");
   src = src.join('');
   var s = document.createElement('script');s.async="async";s.src = src;
   var fjs = document.getElementsByTagName('script')[0];
   fjs.parentNode.insertBefore(s, fjs);
 
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.