Comment

Comment by DeathArrow

Anything object oriented is slower than anything procedural. Boxing and unboxing is expensive, running constructors and destructors is expensive, copying objects is expensive, virtual tables are expensive. And stuff isn't aligned greatly in memory, we can expect lots of cache misses and branch mispredictions.

The fastest possible way is to have C strings in an array and run a function over it.

If there are advantages to OOP, speed is not one of them.

Here's a great talk about software speed: https://www.youtube.com/watch?v=pgoetgxecw8

parent DeathArrow 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton