Writing a Web Server in assembly from scratch
How hard is it to write a web server in pure assembly, using nothing but raw OS system calls? Sounds cool. In this post, I'm going to go through it and explain each step.
/blog
Long-form posts on Linux, performance tuning, and the quiet engineering underneath.
How hard is it to write a web server in pure assembly, using nothing but raw OS system calls? Sounds cool. In this post, I'm going to go through it and explain each step.
A searchable x86-64 Linux syscall table with syscall numbers, argument registers, man-page links, kernel entry points, and common flag values.
We start character-case conversion with the dumbest algorithm with 26 if-else branches and gradually improve the performance until we reach a SIMD case-conversion algorithm.
ASCII table reference with hex and extended table. some quick notes about printable characters, control-code and etc.
A low-level look at how switch-case compiles to assembly, why it's faster than if-else, and the jump-table trick behind the speed.
A short note on why this notebook exists, what's in it, and what to expect from the posts that follow.