An Introduction to Tracy Profiler in C++ - Marcos Slomp - CppCon 2023

  Рет қаралды 15,857

CppCon

CppCon

4 ай бұрын

cppcon.org/
---
An Introduction to Tracy Profiler in C++ - Marcos Slomp - CppCon 2023
github.com/CppCon/CppCon2023
Traditional profilers are prone to skew profiling results due to overhead and time resolution constraints. Moreover, results are commonly presented in some aggregated fashion (e.g., symbol tables, flame graphs, call graphs, etc.) which are unable to pin-point anomalies in a timeline. While insightful, this methodology obfuscates the "when and where" aspect of performance issues, which can lead to rabbit holes and your time wasted.
The Tracy profiler takes a different stance, putting the timeline in the front row. This helps on the identification of pathological cases, and on the performance analysis of specific portions of the program execution. Tracy also enables real-time performance analysis: you can interact with the profiler on-the-fly, as your program runs. While Tracy encourages manual code instrumentation through its minimally invasive, low-overhead, nanosecond resolution annotations, it still supports the more traditional, automatic call stack sampling approach; what's more, there is support for "selective" call stack sampling instrumentation. Even GPU activity can be instrumented and correlated alongside with the CPU timeline. Besides its performance profiling capabilities, Tracy also provides a variety of useful tracing utilities, such as plots, frame delimiters, memory allocation trackers, messages, and plenty more.
This talk will showcase Tracy and make a case as to why it has been an unparalleled tool to assist with research tech transfers at Adobe, as well as in production code, to locate, understand and optimize hot-spots. Tracy is also free and open source, so there's no excuse not to give it a try!
---
Marcos Slomp
Marcos Slomp is a research engineer at Adobe focused on transferring research to products. He is particularly interested in getting the most out of GPU hardware for interactive image processing, 3D graphics and computer vision tasks. Making pixels look prettier and refresh quickly, that sort of thing. At Adobe, he has helped revamp the pixel pipeline in Photoshop, ship an interactive hardware-accelerated path tracing renderer in the Substance suite, revitalize 3D workflows in Illustrator, accelerate neural inference for rotoscoping in After Effects, and some more. He is also keen on investigating creative venues for authoring graphics and to facilitate programming. Before joining Adobe Research, Marcos was an R&D software engineer at Square-Enix, working on the graphics and performance needs of the Kingdom Hearts game franchise. He was also a research professor at Kagoshima University working on dynamic 3D scanning technology. Marcos obtained his PhD from Hiroshima University in Japan and his MS degree from UFRGS in Brazil.
---
Videos Filmed & Edited by Bash Films: www.BashFilms.com
KZbin Channel Managed by Digital Medium Ltd: events.digital-medium.co.uk
---
Registration for CppCon: cppcon.org/registration/
#cppcon #cppprogramming #cpp

Пікірлер: 12
@marcosslomp4375
@marcosslomp4375 4 ай бұрын
Make sure to check the slides, as there's PLENTY of content in there that I could not cover during the talk. Link to the slides is in the video description.
@DIMONSE123
@DIMONSE123 19 күн бұрын
It's an amazing tool, like and use a lot!
@salehjamali8752
@salehjamali8752 4 ай бұрын
this is really cool. hats off
@OneBit74
@OneBit74 4 ай бұрын
tracy is such a nice tool. I love working with it
@rigomatezoltan4302
@rigomatezoltan4302 4 ай бұрын
Wow, a must have tool!
@user-qn8yi3mz8y
@user-qn8yi3mz8y 8 ай бұрын
FYI you can use compile flags to not capture data when the profiler isn't connected. That helps with memory usage.
@seheyt
@seheyt 4 ай бұрын
pretty useful, since the very first program I tried to profile OOM-ed pretty hard in 10s :)
@marcosslomp4375
@marcosslomp4375 4 ай бұрын
Indeed, I did not have time to touch upon the TRACY_ON_DEMAND macro during my talk, but I have it mentioned in the slides.
@marcosslomp4375
@marcosslomp4375 4 ай бұрын
Indeed, I did not have time to cover it, but I mention the TRACY_ON_DEMAND macro in the slides.
@wolpumba4099
@wolpumba4099 19 күн бұрын
*Summary* This talk introduces Tracy, a real-time C++ profiler, highlighting its key features and advantages: *Tracy's Strengths:* * *Real-time Analysis (**0:00**):* Interact with profiling data as the program runs. * *High Precision (**0:00**):* Nanosecond resolution for precise measurements. * *Low Overhead (**0:00**):* Minimal performance impact, allowing for use in production. * *Cross-Platform (**0:00**):* Supports Windows, Linux, macOS, iOS, Android, and potentially WebAssembly. * *Hybrid Profiling (**0:00**):* Combines sampling and manual instrumentation, even for CPU and GPU profiling. * *Powerful Tracing (**0:00**):* Tracks values, messages, plots, memory allocations, and more. * *Easy Integration (**0:00**):* Simple setup with minimal code changes. * *Free and Open Source (**0:00**):* Readily available for anyone to use and contribute. *Key Concepts & Features:* * *Zone Scopes (**20:00**):* The core of Tracy's instrumentation, defining code blocks to be measured. * *Customizable Zones (**20:17**):* Name zones, assign colors, and add values or text annotations. * *Call Stack Capture (**29:53**):* Analyze the call stack at any zone with adjustable depth. * *Message Logging (**32:14**):* Time-stamped, thread-aware message logs replace traditional consoles. * *Data Plotting (**35:27**):* Visualize data trends with customizable plots. * *Memory Allocation Tracking (**37:23**):* Detect memory leaks and analyze allocation patterns. * *Lock Instrumentation (**39:16**):* Identify and visualize thread contention on mutexes. * *Sampling Mode (**49:59**):* Profile without manual instrumentation, useful for initial exploration. *Benefits in Action:* * *Adobe Success Story (**0:00**):* Marcos shares how Tracy was instrumental in optimizing performance for various Adobe products, showcasing real-world examples. * *Quake 2 Demo (**7:38**):* Live demonstration of Tracy profiling a running Quake 2 instance, visualizing frame times, CPU usage, threads, and custom data plots. *Overall:* Tracy offers a compelling alternative to traditional profilers, empowering developers to analyze and optimize C++ code with unprecedented detail and ease. Here are some topics present in the slides that the speaker didn't have time to address during the talk: * *Detailed Tracy Architecture:* While the speaker mentioned the client-server model, the slides delve deeper into network communication and message queues. * *Palliative Workarounds for Tracking Zones Across Threads:* The slides mention using FrameMark, TracyMessage, stairstep plots, and unique colors, which were not discussed. * *GUI Element for Launching Tracy:* The slides suggest embedding a GUI element within the application to launch and connect the profiler for smoother workflows. * *Specific Study Cases from Adobe:* The talk briefly lists successful case studies, but the slides likely contained more detailed descriptions of these optimizations. * *Implicit Deferred Execution Gotchas:* The slides provide code examples and discuss how implicit actions (like smart pointer destruction) can create unexpected gaps in profiling, which wasn't covered verbally. i used gemini 1.5 pro to summarize the transcript and slide deck.
@rcpinto
@rcpinto 4 ай бұрын
Absadan??
@iddn
@iddn 4 ай бұрын
18 mins to get to the point…
Does size matter? BEACH EDITION
00:32
Mini Katana
Рет қаралды 17 МЛН
Каха и суп
00:39
К-Media
Рет қаралды 5 МЛН
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 57 МЛН
C++ Builder design pattern: A pragmatic approach
14:49
platis.solutions
Рет қаралды 3,5 М.
Karl Åkerblom: A quick look at Tracy Profiler
13:21
SwedenCpp
Рет қаралды 2,4 М.
Как правильно выключать звук на телефоне?
0:17
Люди.Идеи, общественная организация
Рет қаралды 1,1 МЛН
АЙФОН 20 С ФУНКЦИЕЙ ВИДЕНИЯ ОГНЯ
0:59
КиноХост
Рет қаралды 336 М.
Красиво, но телефон жаль
0:32
Бесполезные Новости
Рет қаралды 799 М.
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 6 МЛН