Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I recently spent a week or so creating a library for my project. There's not a lot of code, but it was hard to reason about the data model, what I wanted the API to look like, and what I wanted actually rendered on the other side.

I was proud after getting it working, but when I had to run dozens of files through it, it was horribly slow. I don't tend to write a lot of hot code, so I was excited by the fact I had to profile it and make it efficient.

I decided that I should rewrite the system, as my mental model had improved and the code was doing a lot more than it should be doing for no reason. I've spent the last few days redesigning it according to Data-Oriented Design. I'm trying to get the wall-clock time down by more than an order of magnitude. I'm not sure how it's going to turn out, wish me luck :)

Since I mentioned DoD, these three links will probably come up in conversation:

Mike Acton's famous performance talk: https://www.youtube.com/watch?v=rX0ItVEVjHc

DoD in the Zig compiler: https://www.youtube.com/watch?v=IroPQ150F6c

The DoD book: https://dataorienteddesign.com/dodbook.pdf





Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: