Your thoughts on the value of profilers and debuggers?

Started by
6 comments, last by jbadams 8 years, 10 months ago

I never encountered anyone in real life who was a huge profiler fan, like they thought it was super necessary, even though I know quite a few who use them (sometimes? Often? I am not sure.). Some people apparently think that's the case and it got me thinking of the subject of profilers and debuggers.

1. Profilers. First off there were no profilers when I learned to program, and none in college. They might have existed yet but at any rate there were none at my school, and I don't think they existed yet. Maybe that colors my feelings a bit. At any rate I don't think they are necessary at all, I don't know of any super awesome programmer with decades of experience who can't live without them, except on the net where that describes everyone.

In theory it's good but I noticed something that I always thought was true of debuggers: laziness. When people WERE using profilers to measure performance it's like a light switch turned off in their head. It's an automatic tool and it leads to an automatic mental process. You find the part that takes the most time and optimize it. But what happens when your part taking the most time is something like string concatenation?! Then you start making a really cool string class that has super fast string concatenation! At least until Graelig finds out about it and stops the madness by helping you find the real problem!

You also conflate things together that are nothing to do with each other. So even if something like stringcat or a less obviously bogus thing like a cos function is taking most of your time, that doesn't mean that all of these calls are equal. It can be the case that only SOME of these are part of the problem. Calling it in one location is find, in another it is not. Because it's not the cos function that's bad, it's something around it that's bad, so to speak.

So there is a negative side, most importantly, though what's the positive? That is where I wrack my brains. I mean, what does it do you can't do yourself, and do better? If you worked from the top down you would easily get to whatever performance bottleneck you have. What case will it make jump out for you that would be hard to find on your own? There is none I can think of. It highlights the most simple cases, which are easy to find anyway, but can actually help conceal the more problematic cases.

2. Debuggers. I touched on this before about laziness. People have been shocked to learn that I have done so much C++ and assembly while never using a debugger until relatively recently.

Well, I don't know the history of debuggers, but they have been around in some form since I learned to program. Man oh man they were crappy though. Extremely crappy and slow, and you could step through things and miss what was going on.

But a lot of people did like them, some swore by them.

The problem I have is, really they don't help with LOGIC per se. What I mean is, if you really make a bug, a serious bug and not some typo, it is going to trace through just fine and you will have to spend a lot of time tracing to spot it. Like if a sort is sorting backwards or something. Like you have the totally wrong approach to solving a problem. Your debugger won't really find this, not easily anyway. You will kind of have to figure this out on your own regardless of what outputs you are looking at.

It does help with the simple cases, but again the simple cases are easy anyway. After you have decent programming experience you usually know what went wrong the instant it goes wrong - for these simple cases I mean. And you just don't make errors like leaving off the i++ on your for loop any more after a certain point anyway it just becomes so automatic.

Your eyes are much better at scanning code than a debugger is at tracing through to just the right spot.

But in time I changed my mind here to some degree. I still think that using the debugger in THAT way is a waste of time exceptfor when you are learning. But debuggers are a lot better now and are quite useful for crash situations, which could be a fair pain at times without them - though again you get used to what's going to cause it and how to avoid getting into those situations. But you could get screwed by say someone else's code that had to work with YOUR code crashing when you use it because they created a bug like failing to initialize something and you inhereted their bug, and 'they' are some OEM in Hong Kong that it costs thousands of dollars to open a support ticket with and always wastes days and days of your time.

For that, modern debuggers are brilliant, and nowadays C++ is almost as pleasant to program for as Java.

Anyone else feel the same? Or is it only pod people left these days?

This is my thread. There are many threads like it, but this one is mine.

Advertisement

A profiler or timing code can provide you with actual measurements of performance.

Yes, this takes skill to interpret and act upon and can be used to reach false conclusions in some cases; the fact that some users may make mistakes does not make it a bad tool any more than a hammer is a bad tool because some users may mistakenly hit their thumb.


Can you live without a debugger? Absolutely. You're missing out on some great functionality that can make your life easier though.

Can a debugger be used lazily? Sure. Again, some lazy or uneducated users don't mean the tool itself is bad.


If you don't want to use modern tools that's your decision, but counter to your experience all of the best programmers I have worked with swear by both profilers and debuggers.

- Jason Astle-Adams


Your eyes are much better at scanning code than a debugger is at tracing through to just the right spot.

Definitely not always the case. There have been countless times where I've made a typo so innocuous that I've overlooked it time and time again before firing up a debugger which has shown me the problem nearly instantly.

Are debuggers a good replacement for thinking about the problem? - definitely not. And neither are profilers. But both, when used effectively and properly can increase your efficiency dramatically. Really there's no good reason to not use them, and citing not having them when you started programming is certainly not a good reason. They didn't exist when I started coding either, but I'm certainly glad they do now.

HyperV+
greetings

L. Spiro+
People have been asking me why I am not a moderator. During the last 2 months that started to make sense as a question because I have been super-kind and calm.
Even to the guy who reported me. I was literally looking at ways to reduce his down-vote count.

HyperV+
lol

Irlan+
has left the room

L. Spiro+
I thought he was getting down-voted just because the inertia had begun but if someone like me had stepped up it could have stopped it.
That’s a dream now.

This topic stems from a few posts he and I made in another topic, in which he reported one of my jokes to him and of which several admins/moderators/staff notified me. One moderator decided to go through with it and give me an official warning thanks to one of the very rare instances on this site in which I ever joke: “Do you think a profiler raped your sister? I assure you one did not.”

I’ve not been one known to joke at all. And contrarily have been known to speak my mind very directly no matter how devastating it may be on the receiving end.

Graelig, I’m sorry you took that for granted.

You should quit as game programmer. It’s normal for people to learn about debuggers and profilers, but you seem unable to grasp them. My 12-year-old niece asks better questions than you do, and she’s a joy to help. It’s fairly clear that whatever age you are is an age too far. You’ve passed the age where people are receptive to input from their peers, and since you are unable to do this very simple thing you simply do not deserve to join us in the world of programming. Your only use in this world is to remind me what not to become, to maintain a certain level of humility and try to give people the benefit of a doubt. And then they report you.

Most of your posts have been total crap, sometimes misleading. I’ve been somewhat angered reading your posts even before now, while I was still trying to take your side in the very very few places in which you were correct.

This topic isn’t one of them. You’re trying to pick up on a subject where I calmly explained how you were not correct (notice my choice of words—not wrong, but not correct), and in a light-hearted manner I followed with a joke.

Since everyone else can only expect me to tell them the direct facts, I’m afraid I have no choice but to tell you that you are an insult to programmers. You are one of the worst kind who has no idea what the hell he or she is doing but pretends to. This person doesn’t know how to rate his or her own code, but when you approach him or her he or she gets offensive about it instead of learning.

Furthermore, you’re an insult to this site.

You’re not here to learn nor to help. You originally came because you thought you were hot shit but then you found out so many people here are way above you and you can’t handle it. People correct you all the time but you’re an asshole. It’s all ego to you. You don’t deserve to be here. You didn’t start this topic suddenly after I shut you down earlier just because you were interested in what people think about profilers and debuggers. You could at least have the courtesy of pretending to be interested in growing as a programmer.

The most insulting thing is how you use these topics to pull in unsuspecting people who mean well to play your stupid little game. You’s insulting jbadams and LennyLen who took the time to give a real reply to what is basically a troll topic. You couldn’t handle the replies you got on your deleted post so you tried to start it up again in a new light.

You got basically the same replies but you wasted these peoples’ time doing so.

From someone who was originally looking for ways to slow down your down-vote spiral of death, fuck off.

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Can you live without a debugger? Absolutely. You're missing out on some great functionality that can make your life easier though


Not when you get to a certain scale of project or complexity. smile.png Same with profilers.

I challenge the OP to try to "just read through" a 10,000,000 line game engine to figure out why it's getting frametime spikes of 70ms every few seconds, or why a binary-only third-party middleware is crashing when passed parameters that should be totally valid according to the documentation, or to try to debug a black screen in a non-trivial graphics engine without a GPU debugger, or figure out why the OS's disk access is going seemingly unresponsive exactly every minute without a system profiler, etc.

Sean Middleditch – Game Systems Engineer – Join my team!

<snip>

Normally, I'd refrain from posting in this manner, but seeing as you're spewing forth vitriol in public, I wanted to set something straight, which I feel invalidates quite large chunks of your post.
I reported your post.
I reported it, because I do not think rape jokes belong on gamedev.net's forums. The fact that you, despite having your post removed and being given an official warning, choose to repost it here doesn't paint a pretty picture of you in my eyes (although you might not care about what I think of you, which is completely fair!).
In my report, I also wrote I thought the thread needed some cleaning up, as it was starting to turn into personal attacks and insults. This was not directed (only) towards your post, but at least parts of your post were out of line, in my eyes.
In your chat log(?) quote, you seem to think you would be able to step up and defuse the situation. However, proof being in the pudding, you seem to be escalating it instead (based on both this post and the reported post in question).
I am not a moderator. Thus, I tend to report stuff if I see something truly inappropriate/objectionable, if I think replying to it might lead to more off-topic posts and noise, leaving the moderating to the moderators.
You are also not a moderator, but you still seem to think you should decide whether people are fit to be a member or not. You are not the final arbiter of who deserves to be here, even though you throw insults and swear at people when you see fit, behaving like you are both judge, jury and executioner.
That isn't to say I think Graelig's posts are beyond reproach -- I have reported several of his* posts if I found them to be purely trolling, insulting or objectionable, after which I leave it to the moderators to actually deal with them, instead of being some sort of forum vigilante.
Nor is it to say I don't respect a lot of the posts you make -- you have tons of experience and a lot of your posts provide insight which can both spark interesting discussion and help others (including me).
I do not, however, blindly accept everything you post as gospel. If you (or anyone else, for that matter), post rape jokes or something else which I feel crosses the line, I will continue to report it to moderators for them to deal with (unless they ask me to stop, of course).
*Gender assumed.

Hello to all my stalkers.

which I feel invalidates quite large chunks of your post.

It does.

Thank you for the clarification.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

This topic stems from a few posts he and I made in another topic, in which he reported one of my jokes to him and of which several admins/moderators/staff notified me.

[...]
From someone who was originally looking for ways to slow down your down-vote spiral of death, fuck off.

Lactose! has stepped forward as someone who reported the post in question -- I won't break their confidentiality, but suffice it to say that between the post in question and the post I'm replying to a number of members have reported your posts citing things such as "offensive language", "bullying", "directed profanity", etc., and none of whom were Graelig.

We absolutely appreciate all of the time that you put into helping others here, and even the idea of bluntly and directly telling another member (Graelig) that their behaviour is not in line. The same thing could be achieved without the bad language and insults however, and that's all we're asking. I think most people are on board with the sentiment of what you have posted, but some are offended by small parts of the specific content -- and we do have a rule against specifically directing insults or swearwords at other members -- so we would appreciate if you could try to temper your posts to not include some of the profanity and to avoid potentially upsetting subjects such as rape or abuse (example only, I don't believe you joked about abuse) when responding to posts.

That being said, Graelig has been reported many more times recently and is obviously offending a lot more of our community, and I do think your assessment of his behaviour is largely fair. In line with that, Graelig has been temporarily suspended and issued with multiple warnings, while you have simply been given a short-expiring warning.

Do remember also that members like Graelig unfortunately often don't turn around their objectionable behaviour and end up getting themselves banned, and then go on to post in other communities about how bad GameDev.net is, spouting similar claims to those he has already posted here about how people are offensive know-it-alls who aren't really qualified to back up their posts. We all know that you're highly qualified and experienced, but someone who follows a link to this topic that Graelig shares elsewhere may not, and based on what they see here may agree with his (in my opinion) incorrect assessment of our community -- it would be a shame for others to miss out on the benefits of joining our community when they believe those sort of claims because you or another regular member have lost their temper when responding.

All of the above in mind, I do also agree with L. Spiro's assessment that this topic almost certainly wasn't posted as a good-faith effort to learn, but in an attempt to gather support for Graelig's position that wasn't well received in the other topic. Honestly, I would still be happy to respond to it in that case because it can still benefit other members or future searchers who genuinely have similar questions, but paired with the fact that we're now really off-topic, I'm going to nip this one in the bud and close it here.

We would appreciate if everyone could mind their manners and be aware of some of the more potentially offensive subject matters going forwards. Disagreement is welcome here, but it can be done without swearing at or directly (or indirectly) insulting anyone, and I'm genuinely very disappointed that I'm having to type out a warning to such a wonderful contributor to our community because they have been baited into an angry post by another member who has made a habit of the very same behaviour of insulting other members.

A quick thanks to all of the members who took the time to report any posts for moderation recently; on a set of forums this large the moderators simply can't see everything right away, and we appreciate the notice so that we can try to deal with things more promptly.

If anyone is genuinely curious about either profilers or debuggers you should feel welcome to start another discussion, or if anyone wants to discuss how myself or other moderators have dealt with this situation you're welcome to post in the Comments, Suggestions & Ideas forum, to contact me directly, or to contact another moderator you trust.

- Jason Astle-Adams

This topic is closed to new replies.

Advertisement