Tuesday, September 30, 2008

Are your pages crawling across the network instead of flying? Find out why with YSlow!

Quite often a web site works well on the developer’s machine but when it is deployed to another location it starts to crawl. The reason is most of the time the network latency introduced during the deployment. You can mitigate lots of these performance issues with a range of measures nicely described here: http://developer.yahoo.com/performance/rules.html. YSlow will automatically detect most of the potential problems described in the previous document and quickly point you in the right direction.


Impressions

YSlow is a Firefox add-on and it requires Firebug to be already installed. So there is some setup required to get things chugging along but it is all worth it. Once you have it setup you will be able to run an analysis on the current page and YSlow will evaluate and grade several potential problems. Grading makes it very easy to see what areas need your immediate attention and it also gauges progress once modifications are implemented. Not only do you get recommendations to improve the speed but each point is linked to a clear and through explanation of the reasons behind the recommendation so you can take an informed decision if you want to implement them or not.

 

You can also run through the rules used the YSlow here manually if you feel that your case needs some more fine-tuning:

http://developer.yahoo.com/performance/rules.html



Price

Free.

Conclusion

If you develop or own a web site then this is a must have, 5 stars!

Get Firebug from here: http://developer.yahoo.com/yslow/

 

 

Tuesday, September 16, 2008

Find duplicate code with Simian

Find duplicate code with Simian


Impressions

From the developer’s site:

Simian (Similarity Analyser) identifies duplication in Java, C#, C, C++, COBOL, Ruby, JSP, ASP, HTML, XML, Visual Basic, Groovy source code and even plain text files. In fact, simian can be used on any human readable files such as ini files, deployment descriptors, you name it.

 

Sounds too good to pass up so I downloaded a copy. You can only download a tar.gz file, a clear indication that this is not a tool for the fain at heart. I managed to unpack the file and found a copy of the poorly design website inside - monkey and all - along with a bin folder that has the binaries. There are two types of developers targeted here: Java and .NET, I chose to focus on the .NET version so I bravely double-clicked the simian-2.2.24.exe file. A black screen flashed and disappeared. I felt my DOS senses tingling which meant that this was a command line application so I opened a command prompt and ran the EXE again.

 

I won’t put you through all my pain but fiddling with the input parameters I managed to run the application against my code and it printed something like this:

 

 

Found 35 duplicate lines in the following files:

 Between lines 848 and 882 in abc.cs

 Between lines 1059 and 1093 in abc.cs

 

Found 515 duplicate lines in 31 blocks in 7 files

Processed a total of 1243 significant (2510 raw) lines in 8 files

 

Obvious pain points:

 

No easy way to now get this output into Visual Studio and search for the data. Am I supposed to search by line name?

 

No indication on what is duplicated or how severe the duplication is. If you are looking at 1000 duplicated “things” how do you prioritize? Or should I just eliminate all duplicates?

 

It only processed the current folder and I found no obvious way to make it run on all the sub-folders so if you happen to have a bigger project you can simply forget using this tool.

 

It does not do a duplicate search among all the files or if it does it was not clear how to enable the option.


Price

Free for non-commercial and evaluation purposes
$99 for SOHO users

Other licensing options are available on the site.

Conclusion

Nothing good, 0 stars!

You can get Simian from here: http://www.redhillconsulting.com.au/products/simian/