Simon Racz · @simonracz
20 followers · 47 posts · Server discuss.systems

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. :)

youtu.be/ehW2dv0IPIM

Code: github.com/simonracz/threads-s

++

#linux #threads #processes #coroutines #go #rust #Java #c #python #syscalls

Last updated 2 years ago

Stephan Garland · @sgarland
21 followers · 8 posts · Server hachyderm.io

I didn't know you had to hashtag, so reposting.

I'm trying to figure out why 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:

gist.github.com/stephanGarland

I noticed that the SELECT runs a lot of mprotect, as does DROP if run on its own.

/1

#mysql #syscalls #linux #database

Last updated 3 years ago

Stephan Garland · @sgarland
25 followers · 14 posts · Server hachyderm.io

I didn't know you had to hashtag, so reposting.

I'm trying to figure out why 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:

gist.github.com/stephanGarland

I noticed that the SELECT runs a lot of mprotect, as does DROP if run on its own.

/1

#mysql #syscalls #linux #database

Last updated 3 years ago