Saturday, May 08, 2004

Address perf WHERE IT IS NEEDED

I sat in a talk recently on performance with .NET applications. The speaker was suggesting things that I here others say often but I strongly disagree with. Two specific issues were the recommendation to use ngen and to never include debug info in release builds to achieve the best performance. The conversation went something like this:

 I pressed him on the ngen:

Me: I thought one of the reasons you shouldn’t ngen is because the JIT compiler can do optimizations that result in superior runtime performance over ngen?

Him: Well, yes that is true

Me: So if you really care about perf, you shouldn’t ngen?

Him: Yes, but if you ngen you dramatically improve the start up time for the app

Me For the first time the app is run only, right?

Him: Well, yeah….

Me: And, there are load time effects that ngen can have (rebasing) that can actually result in worse load time perf?

Him: Well, yeah…

 

Then the debug info in release mode:

Him: You should definitely avoid putting debug info in your release builds

Me: So what is the impact if you do?

Him: Well, a couple extra instructions per method call

Me: So do you think an extra couple instructions actually has an impact on the overall perf of most apps? Aren’t they usually IO bound or have other perf bottlenecks that really form the performance limit for most apps?

Him:  Well, yeah…

 Why don’t people get this? I'm not saying you shouldn't always consider perf or that you should do stupid things that will affect perf. But if you are doing things that affect the maintainability of your system, I would always favor doing the things that result in more maintainable systems. Then address perf where needed. If your performance is already adequate, then you don't have a problem. If it is not, it is probably due to one or a couple hot spots in your application that you can do some optimization on to get things back in check.

Ngen can either help or hurt perf, and can result in unpredictable results if anything in your system changes with respect to what version gets used. Me, I like deterministic systems. Debug info in your release builds can give you additional insight when errors happen in the production environment including line numbers in exceptions and additional ways to debug.

A lot of it has to do with good architecture and design too. Most often people apply performance tweaks liberally because they have no idea where the hot spots might be in their app or how to find them.

I just get frustrated when people latch onto a concept and apply it blindly without understanding when/where it is actually needed. Let's face it, if a couple extra instructions per method call is really driving the performance of your entire application, you either write some incredibly tight code, or your app is a simple little test app that you created to drive home your point that doesn't go out and make any DB queries, network calls, access the disk, or any of the other things that really drive the perf of real world apps.



.NET | Architecture

Saturday, May 08, 2004 2:32:20 PM (GMT Standard Time, UTC+00:00)
Comments [11]  |  Related posts:
DevConnections Orlando Slides and Demos
Developing Applications with Windows Workflow Foundation LiveLesson
Slides and demos from Cleveland .NET SIG
Silverlight - not just pretty graphics - Cross platform .NET Framework!
Great guidance on using Team Foundation Server for your projects
DevConnections Orlando - a tale of three sessions
Tracked by:
http://www.dasblonde.net/PermaLink.aspx?guid=2f7fbf66-f28b-431d-8e2c-573651f3ed6... [Pingback]
http://www.softinsight.com/bnoyes/PermaLink.aspx?guid=234dcff4-5bc7-4a9b-8434-4e... [Pingback]
http://www.softinsight.com/bnoyes/PermaLink.aspx?guid=e42f2619-1e11-4dc5-bab4-28... [Pingback]
"roulette" (roulette) [Trackback]
"online poker watch list" (online poker watch list) [Trackback]
"blackjack" (blackjack) [Trackback]
"slot machines" (slot machines) [Trackback]
"playing poker online" (playing poker online) [Trackback]
"betting black book jack online sport tip" (betting black book jack online sport... [Trackback]
"michigan casinos" (michigan casinos) [Trackback]
"free internet casino" (free internet casino) [Trackback]
"discover card" (discover card) [Trackback]
"free online slots" (free online slots) [Trackback]
"mega green t diet pills" (mega green t diet pills) [Trackback]
"online casino" (online casino) [Trackback]
"online casino no deposit" (online casino no deposit) [Trackback]
"craps online game" (craps online game) [Trackback]
"casino game" (casino game) [Trackback]
"kasino luck" (kasino luck) [Trackback]
"play online texas holdem" (play online texas holdem) [Trackback]
"888 casino blind " (888 casino blind ) [Trackback]
"blackjack " (blackjack ) [Trackback]
"online casino " (online casino ) [Trackback]
"online craps" (online craps) [Trackback]
"roulette" (roulette) [Trackback]
"discount firstdealpharmacy.com online online pharmacy pharmacy" (discount first... [Trackback]
"craps how to play" (craps how to play) [Trackback]
"tamiflu price" (tamiflu price) [Trackback]
"casino software" (casino software) [Trackback]
"juego casino portales internet" (juego casino portales internet) [Trackback]
"viagra online prescription medication drugs-pharmacy.com" (viagra online prescr... [Trackback]
"baseball betting" (baseball betting) [Trackback]
"Overseas Online Pharmacies" (Overseas Online Pharmacies) [Trackback]
"buy diet online phentermine pill prescription.com viagra" (buy diet online phen... [Trackback]
"cftc and forex futures trading" (cftc and forex futures trading) [Trackback]
"viagra prescription" (viagra prescription) [Trackback]
"florida lottery number" (florida lottery number) [Trackback]
"1078" (1078) [Trackback]
"crisloid championship backgammon" (crisloid championship backgammon) [Trackback]
"alprazolam" (alprazolam) [Trackback]
"poker online" (poker online) [Trackback]
"online poker " (online poker ) [Trackback]
"payday advance" (payday advance) [Trackback]
"hydrocodone online" (hydrocodone online) [Trackback]
"game poker online" (game poker online) [Trackback]
"mastercard" (mastercard) [Trackback]
"online casino punto " (online casino punto ) [Trackback]
"roulette " (roulette ) [Trackback]
"monster craps" (monster craps) [Trackback]
"casino omaha " (casino omaha ) [Trackback]
"casino on net " (casino on net ) [Trackback]
"online casino scalper " (online casino scalper ) [Trackback]
"casino" (casino) [Trackback]
"dollar craps" (dollar craps) [Trackback]
"casino on net" (casino on net) [Trackback]
"amount poker" (amount poker) [Trackback]
"poker " (poker ) [Trackback]
"texas holdem stand " (texas holdem stand ) [Trackback]
"online poker rag " (online poker rag ) [Trackback]
"naproxen" (naproxen) [Trackback]





















Sign In
Copyright © 2006-2007 Brian Noyes. All rights reserved.
designed by NUKEATION STUDIOS