Optimizing your Startup

Tuesday, 29 August 2006 21:08 by admin
Many .Net programmers, including me, have complained on the slow startup of .Net applications. I know that this only occurs during the first execution of your application. Why does this thing happen? It’s because of the JIT compiler. The JIT compiler tends to re-compile your .Net Assembly (.exe, .dll) to produce a native image of that assembly in your computer and store in a cache. As you might have already known, the assemblies that we are compiling in Visual Studio are not the native exe that is being produced in previous COM programming language (Visual Basic 6, Visual C++ 6.0, Delphi, etc.). These assemblies are being compiled to MSIL (Microsoft intermediate language) instead of its native counterpart. And as you might have guessed the MSIL couldn’t be executed directly by the computer and that’s where the JIT compiler comes in. You might be asking, “why not just do it upon compiling my own program in Visual Studio?” To figure this out, we must first learn why this kind of approach was used. The JIT compiler is not really a bad thing. Actually, it makes your program run faster. Well, here’s the concept behind this. The problem on the past COM languages is that even though the executables that they are producing are in native code, these codes are never compatible with other processors. I mean, every processor has its own specifics to enable your program to run faster. And this is where the COM languages fall short. Their executables are only optimized on their development machine. Hence, deploying it to other machines would decrease its compatibility with the processor (except if the developer box is exactly the same with the client box which is unlikely to happen). This is where the JIT compiler comes in. It recompiles your assembly to generate a native code that is fully compatible to your current CPU specifications. This makes your assembly run as fast as possible with your current hardware. But the problem is you’ll have to sacrifice your first execution because this is the time the JIT compiles your assembly. To make this clear, the JIT compiler recompiles your assembly when your assembly doesn’t have a native image in its cache. And the cache is being cleared every time you reboot your computer. So this means tat your program would be recompiled every time it is opened on a newly rebooted PC. But there is a way to tweak your application to make it load much faster even if it is its first time to load. How? Just load your application so that the JIT compiler compiles your program at startup without showing the main GUI of your application. How to do this? Well, I have just learned about this new tool in the Microsoft Framework 2.0 SDK. The ngen.exe. This tool pre-compiles your application and generates the needed native image in the cache. With this, the JIT compiler would not execute and recompile your application when it loads for the first time. Here’s the syntax (it’s being executed in the commandline): C:\ngen install ClientApp.exe Note: The ngen.exe is located in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727 So you must include it in your path or in my case I just created my own batch file that executes whenever Windows XP starts up. Or you can just use the Visual Studio 2005 Command Prompt. PATH=” C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727” Ngen install C:\Program Files\MyProg\App1.exe To learn more about ngen (Native Image Generator). Just look it up on MSDN or in the online MSDN help: http://msdn2.microsoft.com

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:  
Actions:   E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Kevin Mitnick Hacked!

Friday, 25 August 2006 13:08 by admin
Kevin Mitnick, for those who doesn't know this legendary person, he's the world's renounced greatest hacker. He's life has already been featured on a film "Takedown".
 
He's the most wanted cyber criminal in the FBI history. And yes, he has already been arrested several times. But the last time was the longest time he spent in the cell. He has just been released on January 21, 2000. He served nearly 5 years in prison (1,792 days to be exact!).
 
Upon his release, he founded a computer-security based company.
 
And on this day, he just got served! Well, no offense to Kevin, I know he is the greatest and all, but sometimes you'll just have to accept that someon outsmarted you. Hehehe. But in Mitnick's defense, it wasn't he who got hacked but the Hosting company in which he hosted his site. His webpage has been greatly demoralized. His frontpage has been replaced with his modified picture. 

The hackers was traced into Pakistan. Although the entire server of his hosting server was hacked, only the web page of Mitnick was modified which means that its a personal attack to Kevin Mitnick himself (A challenge maybe?). Kevin Mitnick has been one of my inspirations on why I took up Computer Science in my college days. And I really hope that he could have his revenge on those guys! But that means another years in prison eh?!

So what was Mitnick's response to the attacks?

"When I was a hacker, I never stooped to defacing sites because that was more like vandalism; that wasn't any fun. It is more about getting in and being stealth and looking around and exploring."

Straight from the true hacker!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:  
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

un-Planetizing Pluto

Friday, 25 August 2006 00:08 by admin
As of today, there are only 8 official planets in our solar system. Pluto has been demoted to a dwarf planet which in context is not considered as a planet. This was done by a vote among 424 astronomers in the IAU (International Astronomical Union) in Prague.   Astronomers have argued since the late 1990’s, whether to demote Pluto of its planetary status. But sentiments on the issue greatly favored Pluto. But in the end Pluto was indeed kicked out of the planetary status.   “The word "planet" originally described wanderers of the sky that moved against the relatively fixed background of star. Pluto, discovered in 1930, was at first thought to be larger than it is. It has an eccentric orbit that crosses the path of Neptune and also takes it well above and below the main plane of the solar system. Recent discoveries of other round, icy object in Pluto's realm have led most astronomers to agree that the diminutive world should never have been termed a planet. “   So what’s going to happen now? I guess textbooks would have to be rewritten, and history books should be changed. So long Pluto, I’m surely going to miss you!  

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:  
Actions:   E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed