Remix.run Logo
Retr0id 2 hours ago

Looks like the default allocator uses mmap(2) for every single allocation, which is horribly inefficient - you map a whole PAGE_SIZE worth of memory for every tiny string. Aside from just wasting memory this will make the TLB very unhappy.

It looks like sp_log's string formatting is entirely unbuffered which results in lots of tiny write syscalls.

AlotOfReading 2 hours ago | parent [-]

That seems to be a pretty consistent quality level for the entire library. Look at the implementations in sp_math, yikes.

12_throw_away 41 minutes ago | parent | next [-]

Oh man. Oof. I'm sure there must be some repository out there that has an AGENTS.md but isn't pure slopcode, but I haven't seen it yet. The number of people who can be trusted to vibe code "responsibly" is probably about the same as the number of people who can be trusted to write memory safe C.

locknitpicker an hour ago | parent | prev | next [-]

> That seems to be a pretty consistent quality level for the entire library. Look at the implementations in sp_math, yikes.

That does spin the meaning of "Sp.h is the standard library that C deserves"

jcranmer 2 hours ago | parent | prev [-]

"How bad can it be, I mean I know that numerics are not many people's strong suit, but..."

... ... ... oh wow, the math functions are really bad implementations. The range reduction on the sin/cos functions are yikes-level. Like the wrong input gives you an infinite loop level of yikes.

lacewing an hour ago | parent [-]

Commendable accuracy, too: https://godbolt.org/z/s9haz611Y