Pages

Friday, May 28, 2010

Firefox vs Chrome Performance: A language difference?

Like many folks, I've been pretty blown away by the speed of Chrome (especially with respect to running JavaScript intensive sites). Currently, I use both Firefox and Chrome (depending on what I'm doing), but primarily Firefox as there are still some addons I can't live without.

Though I am excited to see the Out Of Process (OOP) Electrolysis project (which is now in beta) and the upcoming JägerMonkey JavaScript engine, I've begun to wonder if some of the performance differences we're seeing are more deeply rooted. Now I do know there are things that are supposedly not possible with Chrome's extension support, and of course with greater functionality comes reduced performance. But I've lately been wondering if the differences are at the language level. Does the language each was written in greatly alter performance? Have a look at this graphic
Source: Ohloh

Just look at all that JavaScript! While some sources favor JavaScript as a "first-class language" (and maybe I'm misinterpreting their meaning here), I'm not convinced that makes sense for desktop applications. There are some advantages to having portions of Firefox be in a web language, it makes it easy for web developers to extend & theme. But I'm not sure it makes sense to use it as extensively as they appear to have done.

For example, it would seem that the addon manager (nsExtensionManager.js) and session storage (sessionStore.js) are both JavaScript. How do I know these are their names? I didn't look at the code, but apparently I was putting Firefox under a bit too much pressure and I got the message saying these scripts had stopped responding (not at the same time). (Though this does happen less often with my portable Firefox, so maybe I need to clear out the profile).

It will of course help when we have the content and the UI in separate processes, and maybe help some more when Firefox gets a faster JavaScript engine, but I wonder if you can ever get really good performance from a language like JavaScript. I'm not saying to write the thing in assembly, I'm just saying maybe it makes sense to write the lower level components in a lower level language. What do you think?

As two somewhat unrelated sidenotes: What do you think the impact on Firefox's future will be with the loss of their tech lead? And do you think Google will finance Mozilla now that they're in some competition with each other?

Friday, May 21, 2010

Syntax Highlighting in Blogger: Round 2

So I'm now able to use the popular SyntaxHighlighter that most blogs use. I don't know what was stopping me before: maybe I've gone up in intelligence or they've fixed some bug. There's excellent instructions here. I think I'm going to make the move to this, since it's easier to read, has more features, and is more standard that the Prettify script I was using before. And one additional nice feature is I don't have to manually set my style="overflow:auto;", instead I just do
<pre class="brush:xml; wrap-lines:false">
And there's no longer a need to do an onLoad in the body tag, and a Groovy brush!
I've gone back to old posts and switched the styles, let me know if I've missed any.

Edit: Actually I think maybe the reason was my own lack of attention. I think I forgot to add 'alexgorbatchev.com' to NoScript's whitelist, and that's the host the scripts are currently hosted on, and it magically started working for me because I was in Chrome instead of Firefox. Doh! ... Doh? Who knows for sure?

Edit: The instructions aren't really up to date anymore, as new brushes have been added. Here is an updated example (note this uses the default theme, but you can choose to use other themes):
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css"></link>
<link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css"></link>
<script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript">
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushAS3.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushBash.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushColdFusion.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCpp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCSharp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushCss.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDelphi.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushDiff.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushErlang.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushGroovy.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJava.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJavaFX.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushJScript.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPerl.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPhp.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPowerShell.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPython.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushRuby.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushScala.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushSql.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushVb.js' type='text/javascript'/>
<script src='http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' type='text/javascript'/>
<script language='javascript'>
SyntaxHighlighter.config.bloggerMode = true;
SyntaxHighlighter.config.clipboardSwf = 'http://alexgorbatchev.com/pub/sh/current/scripts/clipboard.swf';
SyntaxHighlighter.all();
</script>
This still goes inside the header area of the template, which means you'll still need to manually edit the HTML.

OK Maven, You Win

So, I've tried every combination of dependencySets, fileSets, and copyDependencies I could think of, nothing I did seems to work. All I wanted was to have a runnable jar with its dependencies in unexploded jars (something I've done before when making a jar by hand, although I used the default package in that case, not sure if that makes a difference). When I failed in this, I tried to have a runnable jar with its dependencies exploded into a lib directory. I failed in this as well. The only thing that seems to work is to have everything exploded into the same level. I tried this briefly with the shade plugin, but have mostly been trying with the assembly plugin. I give up, Maven. You win.
I've seen this mentioned fairly often on the web. If someone has a working example of a Groovy project compiled into a runnable uber-jar, I'd love to see it.

Friday, February 26, 2010

Workaround for JRA-19248: 401 on Jira Gadgets

Here is a workaround for JRA-19248: Dashboard widgets fail with HTTP 401 malformed security token, when left unattended for some time. Set the 'Refresh Interval' on the gadgets to 1hr (or less).  It's worked for me so far.
Edit: Well, it worked for several days, but apperently 1hr wasn't quite often enough. I'm trying with 30min, someone else reported having to use 15min. One more thing to note is that this issue is fixed with Jira 4.1.

Tuesday, February 9, 2010

Windows Profile Woes

After struggling for months with folders magically changing ownership (first noticed when iTunes couldn't save podcasts) and messages saying the roaming profile did not synchronize completely, I believe I've found the problem. Apparently, Windows profiles changed (though I don't understand how this affects me since although I did an upgrade install of Win7 from Vista, my machine never ran XP or earlier). The migration was failing because there wasn't enough hard drive space to copy all my music, documents, everything twice to do the migration. Though even once I resolved the issues preventing the sync (by moving to a temporary folder in C), it still didn't perform the sync. What I ended up having to do is create a new user, then copy everything over, take ownership, then delete the old user. This problem was also the cause of the mysterious S-{A bunch of meaningless numbers} user and the messages saying I wasn't the owner even though the username of the owner was my username. This was my user account's SID, which it apparently uses as part of the migration.
 
I also learned that there is no Windows equivalent of Linux's usermod (let alone a GUI like Gnome and KDE have) when it comes to renaming accounts and their homes. My plan was to create a new account named Keegan2 then delete the original and rename the new to the old name after I was sure everything was moved over. While you can rename accounts in Windows, it doesn't change the profile path as part of the renaming. There is a registry hack that can be done, but this method gave me issues (all kinds of software installed for all users was still looking in the old place). When I tested this with XP, when I removed the renamed user it didn't remove the files. It would seem like it should be possible to run a script similar to the initialization Windows does the first time a user logs in before migrating to the new name.  This explains the laptop that was re-purposed a few times, but still had all the old usernames in 'Documents and Settings'.

It's a Windows world, but I find the longer I live in it, the more I suffer. Vive Linux!

Monday, February 1, 2010

Aero and LogMeIn

I've had the problem on Vista and Win7 of having Aero disabled after a remote LogMeIn session, even after changing themes to an aero theme and rebooting (the only thing that worked was uninstalling and reinstalling LogMeIn). After having no luck searching the LogMeIn community forums, I finally stumbled across a tip from the folks at Windows 7 Forums:
  1. Uncheck the 'Disable wallpaper and user interface effects on the host computer' in the LogMeIn preferences.
  2. Uncheck the 'Use display accelerator' setting in LogMeIn preferences.
  3. Disable the mirror display device in device manager.
That should do the trick! (Note that this will probably significantly reduce the responsiveness).

Sunday, January 17, 2010

Prevent OpenDNS From Redirecting Google Searches – Fix for Firefox & IE Address Bar

For those of us who enjoy the protection of OpenDNS, but don't want to use the OpenDNS guide, change the value of keyword.url in your about.config to http://www.google.com/search?q=. Thanks to digital inspiration for the tip.