Processes, Threads, Coroutines in Various Programming Languages.
Apart from giving an overview of the topic, I compare the runtime thread count of three different codes in five languages.
A hello world application.
An app that makes three blocking HTTP GET requests.
And finally an async/coroutine/green thread solution for making those same HTTP GET requests.
I was surprised by some results. :)
Code: https://github.com/simonracz/threads-streaming
#linux #threads #processes #coroutines #go #rust #java #c++ #c #python #syscalls
#linux #threads #processes #coroutines #go #rust #Java #c #python #syscalls
I didn't know you had to hashtag, so reposting.
I'm trying to figure out why #mysql 8.0.23 is orders of magnitude faster when doing a TRUNCATE or DROP TABLE if you _first_ run a SELECT COUNT(*) on it. Caching, sure, but why? TRUNCATE is running fallocate, DROP is running unlink.
I compiled it locally and ran it with strace, and captured this:
https://gist.github.com/stephanGarland/a599b78fc2b171d399df843963400857
I noticed that the SELECT runs a lot of mprotect, as does DROP if run on its own.
/1
#mysql #syscalls #linux #database
I didn't know you had to hashtag, so reposting.
I'm trying to figure out why #mysql 8.0.23 is orders of magnitude faster when doing a TRUNCATE or DROP TABLE if you _first_ run a SELECT COUNT(*) on it. Caching, sure, but why? TRUNCATE is running fallocate, DROP is running unlink.
I compiled it locally and ran it with strace, and captured this:
https://gist.github.com/stephanGarland/a599b78fc2b171d399df843963400857
I noticed that the SELECT runs a lot of mprotect, as does DROP if run on its own.
/1
#mysql #syscalls #linux #database