Antoine Pitrou
Antoine Pitrou
Well, if you compile a function in a loop, you will lose a lot of time compiling, so it's much better to move the `@jit` call out of loop anyway....
I've tried this again. Here is a script that shows a bit more useful info during running (and also calls gc.collect() from time to time): https://gist.github.com/pitrou/bada94f31e1c8891585c In 1000 iterations the...
Do you witness different numbers when TLS is turned off?
Also, to get a better idea of what's happening, can you print all deciles rather than simply the average? The actual distribution should be insightful.
Oh, and account `IOStream` and `SSLIOStream` durations separately!
If SSL is turned off and this is a non-blocking socket (as it should be, since we're using Tornado), then the only reasonable explanation is GIL-induced measurement bias. The quantiles...
I'm not surprised. Most calls are quite fast (it's just a non-blocking system call). A small fraction of the calls have to wait for the GIL before returning, and therefore...
In other words, you're just seeing the effects of the GIL on performance of a single thread in a multi-thread Python program. System calls like `socket.send` release the GIL so...
This tooling might be useful to better detect such situations: https://www.maartenbreddels.com/perf/jupyter/python/tracing/gil/2021/01/14/Tracing-the-Python-GIL.html cc @maartenbreddels
> @pitrou Just curious why you think 10ms, I'd guess 5ms from the default of sys.getswitchinterval Hmm, yes, you're right. I was thinking about the typical OS timeslice. > Would...