Posts

Showing posts with the label speed

WebReflection PureDom baseline for TaskSpeed

I just had a quick and nice chat with Peter E Higgins and I am proud to announce that my PureDom test has been integrated into TaskSpeed test suite. Why PureDom We all know how many benefits libraries give us on daily basis about Web 2.0 supersonic development, but as both libraries author and users, we should pay attention. Web Developers: sometime we delegate to our cool library some simple task which could be easily implemented manually. If performances are a problem we should use libraries only when and if necessary. There are a lot of best practices for each library and all we need to do is to read these practices to be sure our way to code is of course elegant, but not silly. // this is silly $("#items li.selected").each(function(){ $(this).css("color", "red"); $(this).css("background", "blue"); $(this).width($(this).parent().width()); }); // ... while this makes sense $("#items li.selected").each(function...

Bases, merits, and defects of packed code

How many times we have seen an included JavaScript apparently incomprehensible? These examples could explain better what I mean: packed.it via MyMin eval((function(M,i,n){return '0("1");'.replace(/\w+/g,function(m){return (n[m]!=i[m]&&i[m])||(i[m]=M[parseInt(m,36)])})})('alert.test'.split('.'),{},Object.prototype)) Dean Edwards packer eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--)d[c]=k[c]||c;k=[(function(e){return d[e]})];e=(function(){return'\w+'});c=1};while(c--)if(k[c])p=p.replace(new RegExp('\b'+e(c)+'\b','g'),k[c]);return p}('1('0');',2,2,'test|alert'.split('|'),0,{})) These are only two parsers which aim is to reduce code size using an inline decompression technique that is able to evaluate source code after common keywords replacement. Basis of portable and packed code The main goal of these services is to compress a source...