Is this safe? Creating a custom profiler

preview_player
Показать описание
#gamedev #gameengine #cpp #indiedev

When making a game with my custom engine I noticed some lag, so I decided to build a custom profiler from scratch to see what was going on.

The engine is written in C++ and supports windows (DirectX and OpenGL), Linux (OpenGL) and macOS (metal).

I use some questionable OS functions to create a profiler.

💭 All views are my own 💭

Рекомендации по теме
Комментарии
Автор

Me, learning OpenGL and game engine internals *woah so hardcore*
This guy "Oh yes, I wrote profilers for 3 different OS's" o_o
awesome =D

MAPster
Автор

Sometimes I feel like UE5 makes it too easy. Contemplating rolling my own engine, I look up channels such as Nathan Baggs. Then I feel a shock that sends me limping back to my safe sandbox like an animal who dared to touch the electric fence.

RandomGuyyy
Автор

Game dev is really hard, especially if you build your own custom 3D engine that supports multiple backends 😂

wilykary
Автор

I found ur channel today in recomended and i love ur videos

boneyboi
Автор

You are my freaking hero. This channel is amazing. Gets me so jazzed about being a programmer like nothing else.

LukeAvedon
Автор

great vid as always but i'd like to see more in-depth on your problem solving, like stepping thru source and showing what functions are actually slow, what did you do to increase perf and so on, anyway keep up with this!

wokeupinthefuture
Автор

Linux to suspend use: kill <pid> -s SIGSTOP
and to resume: kill <pid> -s SIGCONT
and strace command gets stack trace

Andrii-zcdp
Автор

Intresting I remember bukkit (Minecraft plugin server) used to have a timing system similar to the one you described, each action is timed in milliseconds and the highest time can be viewed on its Web interface

penguthepenguinj
Автор

If this is just a hobby what the heck do you do as job?! Very impressive.

Supakills
Автор

Hey, I liked your content. One day I wanna be as good as you in programming. I want to learn assembly and c and be very good at them. What books do you recommend?

AraSec-hjmx
Автор

hello nice video i was wondering what them is ur vscode

itzblinkzy
Автор

3:30 wait.... so you couldn't use 'SIGST' (Ctrl-Z for terminal) or 'kill -STOP PID' & 'kill -CONT PID' for linux?
or strace as a way to get stack traces? (also for linux)

Hope you have a great day & Safe Travels!

TheSensationalMr.Science
Автор

I was wondering

wouldn't it be better to parse the code, inject some clock work, then compile it?
taking a snaphot might be rigged because your cpu is waiting for it's pipeline to flush no?

az-kalaak
Автор

witch software do you use for your animations in your vidios

unLinuxeroMas
Автор

Ah, yes, shader compilation stutter. A seemingly all encompasses problem. 😅

phizc
Автор

Can you explain the problem more in depth?

dhoimkf
Автор

Do you think i could port your engine to a platform that doesnt support any profiler?

KiritoDev
Автор

If you are willing to torture yourself with the worst API ever written, you can get hardware counter data using ETW to microbenchmark things like branch mispredicts in usermode. Might make for a nice follow up video.

charactername
Автор

I didn't got how you get from "I have a working tool that can stop my program and give me the stack trace" to "I have timing information about how my game run".
Did you just get the stack very frequently to have statistical information ?

BTW that's great content, want more :-P

guilhem
Автор

It's very cathartic when a dev vlog starts with "game dev is hard" 🥲

darthtesla