There have being several threads already about how to prettify code when displaying it on blogspot: How to use prettify with blogger/blogspot? and What are the steps I need to take to add nice java code formatting to my blogger/blogspot blog?.
I have tried google's prettify http://code.google.com/p/google-code-prettify/ and syntaxhighlighter http://alexgorbatchev.com/SyntaxHighlighter/. Both are nice. However, I am interested in which has the better performance of both - this is where this thread differs.
Compression
YSlow is telling me neither is being sent compressed to my browser. However, I am not hosting the site myself, I am using google's blogspot for hosting. So, I don't think there is a lot I can do here. Correct?
Cache Both Google's prettify and syntaxhighlighter use javascript files and stylesheets. They host them on a google server and amazon server respectively. if I was hosting files myself I could make use an Apache Http Server and set cache headers on HTTP responses so that returning users don't keep downloading them. If I am not hosting myself and making use of blogspot's free hosting there's nothing I can do, correct?
Server ping time This is a bit a of noddy test. When I ping google's prettify, I get:
Pinging googlecode.l.google.com [209.85.143.82] with 32 bytes of data:
Reply from 209.85.143.82: bytes=32 time=5ms TTL=53
Reply from 209.85.143.82: bytes=32 time=4ms TTL=53
Reply from 209.85.143.82: bytes=32 time=4ms TTL=53
Reply from 209.85.143.82: bytes=32 time=5ms TTL=53
When I ping syntaxhighlighter:
Pinging www.alexgorbatchev.com [69.163.149.228] with 32 bytes of data:
Reply from 69.163.149.228: bytes=32 time=148ms TTL=47
Reply from 69.163.149.228: bytes=32 time=146ms TTL=47
Reply from 69.163.149.228: bytes=32 time=146ms TTL=47
Reply from 69.163.149.228: bytes=32 time=146ms TTL=47
So look's like google's winning this one. Probably using a CDN where I don't think syntaxhighlighter is.
Fewer Http requests
There's a difference of approaches here. Syntaxhighlighter is quite modular with different javascript files for different languages. Google;s prettify using one bigger javascript file. So possible to have a smaller filesize with syntax highlighter if you are including snippets from various languages, you'll of course have more http requests.
So that's the background. The question is what is your performance tip regarding using syntaxhiglighter or google's prettify? How could you make either go faster or ascertain one is faster than the other?
Thanks.