this post was submitted on 15 Nov 2023
788 points (96.1% liked)

Programmer Humor

19648 readers
2651 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
788
Yes (programming.dev)
submitted 1 year ago by mac to c/programmer_humor
 
you are viewing a single comment's thread
view the rest of the comments
[–] agilob 121 points 1 year ago (17 children)

Before nginx was a thing, I worked with a guy who forked apache httpd and wrote this blog in C, like, literally embedded html and css inside the server, so when he made a tpyo or was adding another post he had to recompile the source code. The performance was out of this world.

[–] [email protected] 15 points 1 year ago (4 children)

Does a file lookup really take that long? Id say the trick was to have just plain old html with no bloat and you're golden.

[–] agilob 29 points 1 year ago (1 children)

Blog content was stored in memory and it was served with zero-copy to the socket, so yea, it's way faster. It was before times of php-fpm and opcache that we're using now. Back then things were deployed and communicated using tcp sockets (tcp to rails, django or php) or reading from a disk, when the best HDDs were 5600rpm, but rare to find on shared hosting.

[–] [email protected] 6 points 1 year ago (1 children)

Couldn't the html be loaded into memory at the beginning of the program and then served whenever? I understand the reading from disk will be slow, but that only happens once in the beginning.

[–] [email protected] 3 points 1 year ago

There are plenty of sins people still commit and can commit when it comes to web development. Reading from disk is not the bottleneck. If site is slow most likely it's not the disk read times, database access or anything similar, but silly code that generates the page. It's almost always the code generating the page that's at fault.

load more comments (2 replies)
load more comments (14 replies)