News for hackers. Stuff that matters.
Re:Apple Silicon M1: Black Magic Fuckery by gameswithgo on Wednesday November 25, 2020 @09:42AM (#25209683)
1. structs can have methods 2. the primary value of value types is not to use less ram (you just save a pointer, I guess times two because of GC) but the ability to avoid having to GC the things, since they are either on the stack or in contiguos chunks of memory, and to leverage cpu caches are you can iterate over contiguous data rather than hopping around in the heap. Iterating over contiguous data can be a large constant factor faster than over a collection of pointers to heap objects.

There are no comments on this comment yet.