HackerTrans
TopNewTrendsCommentsPastAskShowJobs

dvko

no profile record

Submissions

Popular websites not compressing their HTML responses

dannyvankooten.com
2 points·by dvko·3 years ago·1 comments

React to SSR+snabbdom to reduce total page weight by over 90%

kokoanalytics.com
1 points·by dvko·3 years ago·0 comments

comments

dvko
·10 months ago·discuss
Never forget! Crazy to see how far it's come. And how lackluster the initial reception on HN was back then.
dvko
·2 years ago·discuss
I got my first 99 after a 15 year break. Farming, obviously!
dvko
·2 years ago·discuss
I’m a bootstrapped founder but hard disagree with this take.

Surely it can’t be the founder taking home a healthy salary from day 1 despite the company being far away from any revenue at all that is taking the risk in your book?
dvko
·2 years ago·discuss
My daily crontab at just after midnight UTC did not run yesterday. I wrote it off as a server hiccup, but now you got me thinking it might be related to leap years…
dvko
·2 years ago·discuss
Hetzner VPS + nginx works fine and goes a looong way. Alternatively, SourceHut pages or GitHub pages is okay too.

If it’s been a while since you did any server work: https://www.dannyvankooten.com/blog/2024/static-site-hosting...
dvko
·2 years ago·discuss
> It says it is free but where is the github page for it?

Not sure if serious, but you do realise that free is not at all about having a GitHub page?

Maxim has been working on nginx for years and just forked the project so that he can continue working on it. The license remains the same as the original nginx project and you can already download its sources here: https://freenginx.org/en/download.html
dvko
·2 years ago·discuss
I never even knew this was an option, despite relying on them for well over 10 years now for well over half of my business' revenue (with 0 issues whatsoever, fwiw). Just enabled it.
dvko
·2 years ago·discuss
Sounds like any static site generator supporting Markdown will do.

- Jekyll: the OG, but requires a ruby toolchain.

- Hugo: compiles to a single static binary, but you may have to get used to its (Go text/html) templating.

- Zola: also compiles to a single static binary, but uses Jinja-like templating.

- Gozer [^1]: my own, like Hugo, but 1000x simpler. I rolled my own because I wanted something that didn't move under me in the next 10 years and just because it was fun and easy enough to build.

[1]: https://github.com/dannyvankooten/gozer
dvko
·2 years ago·discuss
This is inspiring to me, as I'm in a similar boat and while I'm pretty okay at my job in practical terms, I often feel as if I lack a certain mathematical foundation. May I ask how old you are, whether you are enrolled in a full-time course (w/ much younger other students, I suppose?) and how that has been for you?
dvko
·3 years ago·discuss
On most Linux distributions and when the file is mmap'd, if you run it a second time the data will still be in RAM and not have to be read from disk. This gets the runtime down to 1.1s for this AMD 2950x (https://github.com/gunnarmorling/1brc/discussions/46#discuss...).

With SIMD and certain assumptions about the input this can seemingly be further reduced to well under a second, eg see https://github.com/gunnarmorling/1brc/discussions/138.
dvko
·3 years ago·discuss
> I love C.

You and me both. I'm also a polygot but I originally started on interpreted languages like PHP and Python. I then learned some C, which was quite frustrating before I learned how to reason about memory ownership and hold myself to some idioms. Oh and Valgrind.

I then rewrote a bunch of projects in Rust and while it lead to correct and working software, it didn't spark the joy that C did for me. I don't exactly know why and at times I almost feel ashamed to mention this. I do hope there's a future where there's a version of C with some more substantial changes/improvements though, perhaps taking a lesson or two from Rust or Zig (eg string type w/ length).
dvko
·3 years ago·discuss
There’s an implementation in C which should run in well under 2 seconds on your M3.

https://github.com/dannyvankooten/1brc
dvko
·3 years ago·discuss
I tried the linear search by station name in my first naive approach. Using a hashmap was at least 2-3x as fast with the ~415 distinct keys in the 1BRC dataset.
dvko
·3 years ago·discuss
You can run the bin/create-sample program from this C implementation here: https://github.com/dannyvankooten/1brc

It’s just the city names + averages from the official repository using a normal distribution to generate 1B random rows.
dvko
·3 years ago·discuss
There are a handful of implementations in other languages already. Here’s mine in C99: https://github.com/dannyvankooten/1brc

I’ve also seen versions in Rust, Go, Python, Clickhouse and DuckDB. The discussions tab on the GitHub repo lists some of these.
dvko
·3 years ago·discuss
Very fun challenge that nerd sniped me right away. Had to do a C version in standard C99 with POSIX threads. It[1] clocks in at just under 4 seconds on my AMD Ryzen 4800U Laptop CPU.

Should run about 10-20% faster than that on the mentioned Hetzner hardware.

- Since we only do one decimal of floating point precision it uses integer math right from the get-go.

- FNV1-a hash with linear probing and a load factor well under 0.5.

- Data file is mmap’d into memory.

- Data is processed in 8 totally separate chunks (no concurrent data structures) and then those aggregations are in turn aggregated when all threads have finished.

1: https://github.com/dannyvankooten/1brc
dvko
·3 years ago·discuss
You say database book, I say Klepmann.
dvko
·3 years ago·discuss
Not this again. This is a number that has been doing the rounds but can be dismissed as false after less than 30 seconds of using Google and a tiny bit of brainpower.

That I had to read this on Hacker News saddens me.

It’s at least 33%, not 3%. Also it’s the total amount of CO2 in the atmosphere that matters, not so much the proportion. Pretty much all CO2 above 1850 baseline levels are the direct result of human-caused emissions.
dvko
·3 years ago·discuss
As a fun experiment I grabbed a list of the top 10.000 most popular domains on the internet (according to their Alexa rank) and checked each of them for compression on their HTML responses. Some of them are leaving quite substantial reductions in size on the table by not applying any compression at all.

Some notable entries that caught my eye are the websites of the US Department of State, multiple country specific branches of Lidl, the Python programming language, Klarna and Zapier.
dvko
·3 years ago·discuss
Have been running Mailinabox since 2018 on a €5 VPS. 0 issues with email deliverability. Or anything really. It just works.