Hi, for my Pycon talk on "When to use Rust Native ...
# development
h
Hi, for my Pycon talk on "When to use Rust Native Extensions", I want a slide that refers to some profiling tools that can be helpful to decide if it's worth trying an extension *and/or evaluating its utility. Thoughts on the below? Am I missing any, e.g. how to profile if you're IO bound?
e
I can't see how the 1st row helps a decision ahead of time. Those tools help prove the idea was good after implementing.
h
True, good point on 1st row
e
You could use
(real - (user + sys)) / real
and if greater than, say, 50% decide you must be doing alot of io and so maybe you should switch to event driven parallelism. But that just points you to asyncio.
šŸ‘ 1
w
i did a little screencast to explain how to detect GIL contention on OSX: https://drive.google.com/file/d/1ayuQpehEDrSahdXVdOSTIK5hlQrJhguL/view?usp=sharing ā€¦ uses this repository: https://github.com/stuhood/rust-cpython-concurrency
šŸ™Œ 1
c
copy paste from my todo list of things to look into, for the profiliing section: Profiling & Performance tools ā€¢ https://github.com/nvdv/vprof ā€¢ https://github.com/nylas/nylas-perftools ā€¢ https://github.com/evanhempel/python-flamegraph ā€¢ http://www.brendangregg.com/flamegraphs.html#Updates I would definitely at least mention flamegraphs. Really useful to determine where you spend your time in a callstack.
šŸ’Æ 1
šŸ™Œ 1
h
Indeed on flamegraphs! That's what Snakeviz is, but probably worth saying something like "flamegraphs, e.g. Snakeviz"
šŸ‘ 1
Thanks @witty-crayon-22786, that video was awesome! Would you be willing to upload it to YouTube, maybe under pantsbuild account? I fear I'm already well exceeding the 25 minutes for my talk, so there's no way I can fit that into the talk. But I can point out that measuring the GIL is tricky because time waiting matters, and refer to this YT video
w
sure

https://youtu.be/zALr3zFIQJoā–¾

šŸ™Œ 1