Date: Sun, 17 Jul 2022 19:45:00 -0400
<div class="wp-block-jetpack-markdown"><h2>Summary</h2> <p>As your code scales beyond a trivial level of complexity and sophistication it becomes difficult or impossible to know everything that it is doing. The flow of logic and data through your software and which parts are taking the most time are impossible to understand without help from your tools. VizTracer is the tool that you will turn to when you need to know all of the execution paths that are being exercised and which of those paths are the most expensive. In this episode Tian Gao explains why he created VizTracer and how you can use it to gain a deeper familiarity with the code that you are responsible for maintaining.</p> <h2>Announcements</h2> <ul> <li>Hello and welcome to Podcast.__init__, the podcast about Python’s role in data and science.</li> <li>When you’re ready to launch your next app or want to try a project you hear about on the show, you’ll need somewhere to deploy it, so take a look at our friends over at Linode. With their managed Kubernetes platform it’s easy to get started with the next generation of deployment and scaling, powered by the battle tested Linode platform, including simple pricing, node balancers, 40Gbit networking, dedicated CPU and GPU instances, and worldwide data centers. And now you can launch a managed MySQL, Postgres, or Mongo database cluster in minutes to keep your critical data safe with automated backups and failover. Go to <a href="https://www.pythonpodcast.com/linode?utm_source=rss&utm_medium=rss">pythonpodcast.com/linode</a> and get a $100 credit to try out a Kubernetes cluster of your own. And don’t forget to thank them for their continued support of this show!</li> <li>Need to automate your Python code in the cloud? Want to avoid the hassle of setting up and maintaining infrastructure? Shipyard is the premier orchestration platform built to help you quickly launch, monitor, and share python workflows in a matter of minutes with 0 changes to your code. Shipyard provides powerful features like webhooks, error-handling, monitoring, automatic containerization, syncing with Github, and more. Plus, it comes with over 70 open-source, low-code templates to help you quickly build solutions with the tools you already use. Go to <a href="https://www.dataengineeringpodcast.com/shipyard?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">dataengineeringpodcast.com/shipyard</a> to get started automating with a free developer plan today!</li> <li>Your host as usual is Tobias Macey and today I’m interviewing Tian Gao about VizTracer, a low-overhead logging/debugging/profiling tool that can trace and visualize your python code execution</li> </ul> <h2>Interview</h2> <ul> <li>Introductions</li> <li>How did you get introduced to Python?</li> <li>Can you describe what VizTracer is and the story behind it?</li> <li>What are the main goals that you are focused on with VizTracer?</li> <li>What are some examples of the types of bugs that profiling can help diagnose? <ul> <li>How does profiling work together with other debugging approaches? (e.g. logging, breakpoint debugging, etc.)</li> </ul> </li> <li>There are a number of profiling utilities for Python. What feature or combination of features were missing that motivated you to create VizTracer?</li> <li>Can you describe how VizTracer is implemented? <ul> <li>How have the design and goals changed since you started working on it?</li> <li>There are a number of styles of profiling, what was your process for deciding which approach to use?</li> </ul> </li> <li>What are the most complex engineering tasks involved in building a profiling utility?</li> <li>Can you describe the process of using VizTracer to identify and debug errors and performance issues in a project?</li> <li>What are the options for using VizTracer in a production environment?</li> <li>What are the interfaces and extension points that you have built in to allow developers to customize VizTracer?</li> <li>What are some of the ways that you have used VizTracer while working on VizTracer?</li> <li>What are the most interesting, innovative, or unexpected ways that you have seen VizTracer used?</li> <li>What are the most interesting, unexpected, or challenging lessons that you have learned while working on VizTracer?</li> <li>When is VizTracer the wrong choice?</li> <li>What do you have planned for the future of VizTracer?</li> </ul> <h2>Keep In Touch</h2> <ul> <li><a href="https://github.com/gaogaotiantian?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">gaogaotiantian</a> on GitHub</li> <li><a href="https://www.linkedin.com/in/tian-gao-34bb6326/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">LinkedIn</a></li> </ul> <h2>Picks</h2> <ul> <li>Tobias <ul> <li><a href="https://www.imdb.com/title/tt5651844/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Travelers</a> show on Netflix</li> </ul> </li> <li>Tian <ul> <li><a href="https://github.com/gaogaotiantian/objprint?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">objprint</a></li> <li><a href="https://www.netflix.com/title/81303831?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Lincoln Lawyer</a></li> <li><a href="https://space.bilibili.com/245645656/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">bilibili</a> – Tian’s coding sessions in Chinese</li> </ul> </li> </ul> <h2>Closing Announcements</h2> <ul> <li>Thank you for listening! Don’t forget to check out our other shows. The <a href="https://www.dataengineeringpodcast.com?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Data Engineering Podcast</a> covers the latest on modern data management. The <a href="https://www.themachinelearningpodcast.com?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Machine Learning Podcast</a> helps you go from idea to production with machine learning.</li> <li>Visit the <a href="https://www.pythonpodcast.com?utm_source=rss&utm_medium=rss">site</a> to subscribe to the show, sign up for the mailing list, and read the show notes.</li> <li>If you’ve learned something or tried out a project from the show then tell us about it! Email <a href="mailto:hosts@podcastinit.com">hosts@podcastinit.com</a>) with your story.</li> <li>To help other people find the show please leave a review on <a href="https://itunes.apple.com/us/podcast/podcast.-init/id981834425?mt=2&uo=6&at=&ct=&utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">iTunes</a> and tell your friends and co-workers</li> </ul> <h2>Links</h2> <ul> <li><a href="https://viztracer.readthedocs.io/en/latest/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Viztracer</a></li> <li><a href="https://docs.python.org/3/library/profile.html#module-cProfile?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Python cProfile</a></li> <li><a href="https://en.wikipedia.org/wiki/Profiling_(computer_programming)#Statistical_profilers?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Sampling Profiler</a></li> <li><a href="https://perfetto.dev/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Perfetto</a></li> <li><a href="https://coverage.readthedocs.io/en/latest/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Coverage.py</a> <ul> <li><a href="https://www.pythonpodcast.com/coverage-py-with-ned-batchelder-episode-121/?utm_source=rss&utm_medium=rss">Podcast Episode</a></li> </ul> </li> <li><a href="https://docs.python.org/3/library/sys.html#sys.setprofile?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Python setxprofile hook</a></li> <li><a href="https://en.wikipedia.org/wiki/Circular_buffer?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Circular Buffer</a></li> <li><a href="https://chromium.googlesource.com/external/github.com/catapult-project/catapult/+/refs/heads/master/tracing/docs/getting-started.md?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Catapult Trace Viewer</a></li> <li><a href="https://github.com/benfred/py-spy?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">py-spy</a></li> <li><a href="https://github.com/giampaolo/psutil?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">psutil</a></li> <li><a href="https://www.sourceware.org/gdb/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">gdb</a></li> <li><a href="https://www.brendangregg.com/flamegraphs.html?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">Flame graph</a></li> </ul> <p>The intro and outro music is from Requiem for a Fish <a href="http://freemusicarchive.org/music/The_Freak_Fandango_Orchestra/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">The Freak Fandango Orchestra</a> / <a href="http://creativecommons.org/licenses/by-sa/3.0/?utm_source=rss&utm_medium=rss" rel="noopener" target="_blank">CC BY-SA</a></p> </div> <img alt="" height="0" src="https://analytics.boundlessnotions.com/piwik.php?idsite=1&rec=1&url=https%3A%2F%2Fwww.pythonpodcast.com%2Fviztracer-visual-python-profiling-episode-371%2F&action_name=Gain+A+Deeper+Understanding+Of+What+Your+Code+Is+Doing+And+Where+It+Spends+Its+Time+With+VizTracer+-+Episode+371&urlref=https%3A%2F%2Fwww.pythonpodcast.com%2Ffeed%2F&utm_source=rss&utm_medium=rss" style="border: 0; width: 0; height: 0;" width="0" />