3 ms·
What kind of profiler can tell which areas the CPU is burning cycles? Like, just mapping a bunch of known function and timing? Then every "ssl_" function is cl
by djbusby 4y ago
What kind of profiler can tell which areas the CPU is burning cycles?
Like, just mapping a bunch of known function and timing? Then every "ssl_" function is classified as crypto time? And every "net_" function is networking? (Or something like that?)
- toast0 4y agoIntel vTune and AMD uProf, as well as opensource tools like hwpmc for FreeBSD and perf for Linux.
- Matthias247 4y agoperf can do the job on Linux. Networking cost will be within callstacks for the system calls that send and receive packets (sendmsg, sendmmsg, recvmsg, recvmmsg). Crypto cost in functions which sound like the crypto primitives being used. They typically won't have ssl_ in the name, because QUIC implementations directly make use of lower-level primitives - that are e.g. exposed by libcrypto/ring/etc. Here's one example of an old profile using Quinn: https://gist.githubusercontent.com/Matthias247/47dc290dde72e2e2f581a114234e8382/raw/c7afb63f0eeae4d3c7f8429d54eb6cdeb47df7f3/8x_gso_memory_opts.svg https://gist.githubusercontent.com/Matthias247/47dc290dde72e... It clearly shows the networking and crypto parts (here using ChaCha20). However don't interpret too much into the actual values in this graph, since the profile is nearly 2 years, uses ChaCha20 instead of AES (much more expensive), and used loopback networking (cheaper than the real thing).