Click here to Skip to main content
15,915,093 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Does anybody really use a Profiler? Pin
SledgeHammer0113-Sep-14 14:13
SledgeHammer0113-Sep-14 14:13 
GeneralRe: Does anybody really use a Profiler? Pin
Slacker00713-Sep-14 14:21
professionalSlacker00713-Sep-14 14:21 
GeneralRe: Does anybody really use a Profiler? Pin
SledgeHammer0113-Sep-14 14:40
SledgeHammer0113-Sep-14 14:40 
GeneralRe: Does anybody really use a Profiler? Pin
Slacker00713-Sep-14 14:46
professionalSlacker00713-Sep-14 14:46 
GeneralRe: Does anybody really use a Profiler? Pin
newton.saber13-Sep-14 14:51
newton.saber13-Sep-14 14:51 
GeneralRe: Does anybody really use a Profiler? Pin
SledgeHammer0113-Sep-14 15:11
SledgeHammer0113-Sep-14 15:11 
GeneralRe: Does anybody really use a Profiler? Pin
BillWoodruff13-Sep-14 18:24
professionalBillWoodruff13-Sep-14 18:24 
GeneralRe: Does anybody really use a Profiler? Pin
Member 1046259815-Sep-14 4:55
professionalMember 1046259815-Sep-14 4:55 
Yes, but before I do, your original email opens up a bigger issue, I think. To demonstrate, let me ask:
Does anybody really use a debugger? You see, I think that any real software engineer should be able to write bug-free code and if looking at someone else's code, should be able to identify the bugs in a fairly straight forward process.

Pretty silly, right?

Of course this is tonge-in-cheek, but the point is that a profiler is a tool that has a place in the engineer's toolbox. By asking the question in a way that belittles the use of the tool, it seems the results of the answers will be biased, or at least the interpretation of the results will be.

(Full disclosure: Maybe there are a few who are so good they can optimize their code without a profiler, but I have learned the hard way that I am not one of those - I also used to believe profilers are for the weak.)

Engineers use tools. Engineers use data from experiments to test their products and, maybe, improve them. Ignoring a tool doesn't make sense to me.

I agree that profilers can be hard to use and produce a lot of noise, but using a lathe is hard, too, until you understand how to get good results from it. A profiler is not the primary tool, to be sure, but there are cases where it can be Indispensable (and has been to me). Here are where I think it makes a lot of sense:

1) Education: How does one get experienced in performance analysis and tuning with C#. And how to we know we are right? Sure, moving the invarient out of the loop make it run faster, but are there other things we could/should have done, as well? Profilers are a great way to learn where the bottlenecks are, especially when working with a new language or in a new environment. One line of code taking 85% of my runtime? How do I know it's that one? (Linq is an easy target, but what about your enum example? How do you know the first time?) I've had experiences similar to yours where I see something obviously bad and let the designer know only to be told "no way it's my problem"; When I show them profiling output proving they are the problem, they start to listen. Data are powerful things!


2) Real-time systems: I think much of the discussion on this thread has been about business-logic type applications. Large databases, searching, etc. But what if you are building a real-time processing system with streaming data in one thread, real-time analysis/processing in another and real-time display in a third (and it's actually much more complicated that that in real life as those threads are really collections of threads, possibly). I live in this world and I can tell you that I use a profiler before my final build (often many times, but certainly once!) to see how much slack I have. That is, where do I have performance issues that are close to being a problem. For those are the ones that may bite me in real-world use. My stopwatch tells me I'm OK, but I'm not. (Concrete example, I need to process 100 frames of data per second. I profile the code and find my main processing loop takes 0.009 ms. So I'm good, right? Well what happens if something else is running on the same machine, taking cycles away from me? I want to look at that function to squeeze out more performance if I can. And each change I make can be profiled to see if what I did really was an improvement or not and by how much. Some performance improvements require tricky code or code that's harder to maintain but provide very little real-world improvement; I stay away unless I really need every microsecond. I want to know, however, not just optimize until I can't any longer... and, yes, I've gone so far as to write in-line assembly code where I needed to! But I don't want to go there in my first pass of optimization.

3) Proving to a component manufacturer that their component is the problem. I've been here, also. I have a DLL from a hardware manufacturer that is causing a problem and I can prove it by getting accurate timings of how long some of their calls take. Yes, simple timer calls can be used for this, as well, but when I'm calling several dozen such functions, running the profiler can give me all the timings, quickly, and I am not modifying my code to do so.

4) Finding bugs. Yes! Similar to #2, actually. Imagine you have a program that meets the spec in terms of performance. So you ship. But you have one section of code that calls a function multiple times for no good reason. This is poor programming, but because it's done in multiple threads or in various methods that are not obviously related so it's hard to spot. The profiler can show that CheckStatus (for example) is being called a lot. You may look at to why this is and could fix what is currently (or soon to be) a bug in logic. If you are running on a system where battery life is important, then I consider this a bug.

I know you may not be convinced, and that's OK. I do 100% agree that understanding what you are doing, thinking and analyzing code FIRST is very important, but I don't think it's enough for most people.

I think this is a great discussion for opening up these potential issues.

Thanks!
AnswerRe: Does anybody really use a Profiler? Pin
newton.saber13-Sep-14 14:07
newton.saber13-Sep-14 14:07 
GeneralRe: Does anybody really use a Profiler? Pin
SledgeHammer0113-Sep-14 14:27
SledgeHammer0113-Sep-14 14:27 
GeneralRe: Does anybody really use a Profiler? Pin
newton.saber13-Sep-14 14:46
newton.saber13-Sep-14 14:46 
AnswerRe: Does anybody really use a Profiler? Pin
Andy Brummer13-Sep-14 16:16
sitebuilderAndy Brummer13-Sep-14 16:16 
AnswerRe: Does anybody really use a Profiler? Pin
BillWoodruff13-Sep-14 18:18
professionalBillWoodruff13-Sep-14 18:18 
AnswerRe: Does anybody really use a Profiler? Pin
Kornfeld Eliyahu Peter13-Sep-14 20:06
professionalKornfeld Eliyahu Peter13-Sep-14 20:06 
GeneralRe: Does anybody really use a Profiler? Pin
SledgeHammer0113-Sep-14 20:24
SledgeHammer0113-Sep-14 20:24 
GeneralRe: Does anybody really use a Profiler? Pin
Kornfeld Eliyahu Peter13-Sep-14 20:35
professionalKornfeld Eliyahu Peter13-Sep-14 20:35 
AnswerRe: Does anybody really use a Profiler? Pin
Nagy Vilmos13-Sep-14 20:40
professionalNagy Vilmos13-Sep-14 20:40 
AnswerRe: Does anybody really use a Profiler? Pin
harold aptroot13-Sep-14 20:54
harold aptroot13-Sep-14 20:54 
AnswerRe: Does anybody really use a Profiler? Pin
Mark_Wallace13-Sep-14 21:01
Mark_Wallace13-Sep-14 21:01 
AnswerRe: Does anybody really use a Profiler? Pin
wout de zeeuw13-Sep-14 22:09
wout de zeeuw13-Sep-14 22:09 
GeneralRe: Does anybody really use a Profiler? Pin
Nelek14-Sep-14 0:52
protectorNelek14-Sep-14 0:52 
AnswerRe: Does anybody really use a Profiler? Pin
Gary R. Wheeler14-Sep-14 3:01
Gary R. Wheeler14-Sep-14 3:01 
AnswerRe: Does anybody really use a Profiler? Pin
Pete O'Hanlon14-Sep-14 6:54
mvePete O'Hanlon14-Sep-14 6:54 
AnswerRe: Does anybody really use a Profiler? Pin
macu14-Sep-14 21:49
macu14-Sep-14 21:49 
AnswerRe: Does anybody really use a Profiler? Pin
dazfuller14-Sep-14 22:08
dazfuller14-Sep-14 22:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.