Fast. Free. Forever.

by Chris Eargle | Comments 4

We began the development cycle with one primary goal: make JustDecompile a flawless, shining example of software engineering. We knew it was a pie in sky goal to complete in only a few a months, but to capture the moon you must reach for the stars.

And capture the moon we did. Our tests show that against the .NET Framework 4, JustDecompile is the fastest decompiler for .NET.

The skeptics among you may have noticed my word usage leaves wiggle room. To be clear, it is possible a decompiler no one has ever heard of beats us at decompiling a .NET 2.0 application modified with IL injection. Exhausting every possible combination isn’t productive, and we originally just needed a measure of our progress. To accomplish this, we compiled a list of well-known decompilers and culled ones that had no public means of automation. The lack of automation greatly hinders one’s ability to decompile an entire assembly and retrieve the time lapse, and it certainly wouldn’t be fast for a user. We also needed to prevent bias from programming style and other factors affecting the compiled byte code. Therefore, we targeted the edition of the .NET Framework in common usage at the beginning of our development cycle.

Were we the best at the beginning? It was a mixed bag. We were more correct with some assemblies and faster with others. To ensure JustDecompile is the best choice for the majority of .NET applications, we focused on the average speed and full error count over the entire framework. We weren’t winning, but we weren’t losing either.

I don’t want to say that increasing the accuracy of the decompiled code was easy. JustDecompile is one of the more recent products at Telerik. However, our team is excellent, and most inaccuracies are due to edge cases. Fixing them is a matter of finding those edge cases, determining why the compiler produced the sampled IL, and then finding a way to represent that IL like, if not exactly like, the original code.

The accuracy challenge began as a known quantity. Meanwhile, we faced another challenge to increase JustDecompile’s performance, and the solution was just down the hall at Telerik HQ.

Funny story: JustTrace already uses the JustDecompile engine.

The Wizard Ninjas aided the Spartan Ninjas in their quest for superiority. Pounds (kilos) were shed, muscles were cut, and Nicholas Cage filmed yet another movie (or two) no one watched. The leaner, meaner JustDecompile came out of training just last week.

Opening one of my web projects, I pulled out WebGrease.dll. My goal was to make the decompilers cry, and WebGrease happened to be the largest assembly in my bin directory. JustDecompile decompiled the entire assembly in 4.8 seconds. That doesn’t sound impressive, but it decompiled the much smaller AutoMapper in 0.1 seconds.

I am aware of only two other decompilers that can do an entire assembly at once. The first one I tested handled the assembly in 5.6 seconds, but there was an additional second or two beyond when it “finished” and the screen unlocked (note: if you’re experiencing similar behavior in your apps, upgrade to C# 5 and take advantage of async/await).

The second decompiler took ~50 seconds before it completed.

Using the C# compiler to measure errors wasn’t much help since it always gave up after a small number of errors. I turned to JustCode to obtain a thorough analysis. It found 207 errors in the JustDecompile output, mostly related to Code Contracts attributes. That certainly does not look good, but it’s far better than the 7947 and 8501 errors from the other products. Both made a fundamental mistake: not including the references in the output. I’m more interested in the quality of code output, so I quickly fixed the issue by adding a reference. Seconds later, I was able to see the pattern matching errors: 305 for one and 833 for the other. These errors included labelled, fall-through switch statements and other difficult-to-correct constructs.

The JustDecompile development team did an amazing job. They’ve released a free product that outperforms everyone else. If you’re still skeptical, I respect that. Try it out for yourself.

There’s still some room for improvement. We may have captured the moon, but we’re still aiming for the stars.

JustDecompile banner

About the author

Chris Eargle

Chris Eargle

is a Telerik Technical Evangelist and Microsoft C# MVP with over a decade of experience designing and developing enterprise applications, and he runs the local .NET User Group: the Columbia Enterprise Developers Guild. He is a frequent guest of conferences and community events promoting best practices and new technologies. Chris is a native Carolinian; his family settled the Dutch Form region of South Carolina in 1752. He currently resides in Columbia with his wife, Binyue, his dog, Laika, and his three cats: Meeko, Tigger, and Sookie. Amazingly, they all get along... except for Meeko, who is by no means meek.

4 Comments

Dejan
I've used JustDecompile in the past and it's a nice product. I got a new dev machine in the meantime and I realized that I no longer have it, so I tried installing and I got reminded of the Telerik Trial Installer that doesnt give you an option not to install the Telerik Control Panel. It may sound absurd, but this was a reason for me to close the installer without installing. I have enough programs on my PC as it is, there really is no need for more :)
Chris Eargle
I'm sorry to hear that, Dejan. I understand why this would be a problem, and I'll check on it to make sure you're not forced to install the control panel.
Jeff
I agree with Dejan.  Six months or so ago I started to looking into JustDecompile.  It's been a while, so my memory is hazy, but I seem to recall...

1) The first stumbling block was that I had to register.  OK, that wasn't that big of a deal, but it was a road bump and a barrier, and wasn't a "one-click just click to download" operation.

2) When I did download the installer, it wasn't just the JustDecompile that was going to be downloaded, it was a whole suite of components and the download size was huge.  I don't remember the size, but it was immensely disproportionate with the size a tool like JustDecompile should have been.

My recommendation would be to make JustDecompile a single installer and don't add other components like control panels, updaters, the UI toolboxes, etc...

Jeff
Kevin Babcock
Dejan, Jeff:

I think this may have just been an oversight as the installer was a very welcome addition for licensed customers, especially those who use multiple Telerik products. However, there are stand-alone installers for all Telerik products for licensed users so hopefully Telerik will be able to provide those for their non-licensed customer base as well.

Either way, please give JustDecompile a try. As a long-time user of Reflector it took me a little time to get used to the new UI. Now that I've been using JustDecompile for a couple of years I recently went and installed Reflector to compare the two. I can safely say I am so happy I made the switch.

Regards!

Comments

  1.    
      
      
       
  2. (optional, emails won't be shown on public pages)
  3. (optional)
Read more articles by Chris Eargle - or - read latest articles in Developer Tools