#asahi · 2022-02-25 10:12
kode54it gets 0.314s real, 0.258s user, 0.056s system#asahi · 2022-02-25 10:11
kode54Intel machine, fares twice as bad#asahi · 2022-02-25 10:10
kode54let's see how Ubuntu fares with its stock glibc#asahi · 2022-02-25 10:09
kode54that's, 1048576 mallocs, then half that free, then realloc the remaining ones to random size up to twice the original size, then malloc the same size range into the original freed slots, then free it all#asahi · 2022-02-25 10:09
kode54er, of cpu time, user+system#asahi · 2022-02-25 10:08
kode54latest version gets about 0.236s of real time doing that mess#asahi · 2022-02-25 10:08
kode54https://gist.github.com/kode54/f77aa7bdc5e802268ccde84953456ce4#asahi · 2022-02-25 10:04
kode54let's see how it handles fragmentation#asahi · 2022-02-25 10:02
kode54so basically 0.1s total processing time for over a million randomly sized allocations#asahi · 2022-02-25 10:00
kode54then freeing them all#asahi · 2022-02-25 10:00
kode54mallocing 4MB of RAM as a pointer store, then allocating (rand() & 255) + 1 1048576 times#asahi · 2022-02-25 10:00
kode54./malloctest 0.07s user 0.03s system 96% cpu 0.102 total#asahi · 2022-02-25 10:00
kode54./malloctest 0.07s user 0.04s system 33% cpu 0.319 total#asahi · 2022-02-25 10:00
kode54% time ./malloctest#asahi · 2022-02-25 10:00
kode54% time ./malloctest#asahi · 2022-02-25 09:59
kode54huh#asahi · 2022-02-25 09:55
kode54hmm?#asahi · 2022-02-25 09:45
kode54I wonder what it could be#asahi · 2022-02-25 09:45
kode54huh, memory usage seems to be climbing#asahi · 2022-02-25 09:44
kode54my audio player is using 74.2 MB of RAM#asahi · 2022-02-25 09:44
kode54let's see#asahi · 2022-02-25 09:44
kode54also annoying that I see people saying the issue is not memory latency, but memory usage period#asahi · 2022-02-25 09:43
kode54annoying#asahi · 2022-02-25 09:35
kode54they're hard coding the page size to structure sizes#asahi · 2022-02-25 09:33
kode54clearly they are doing too much already#asahi · 2022-02-25 09:31
kode54or, why do we need low latency high interactive web pages#asahi · 2022-02-25 09:31
kode54why does a document viewer need hyper low latency#asahi · 2022-02-25 09:30
kode54I had to add copious amounts of @autoreleasepool s to lots of places in the audio chain, because it was allocating out of control and not releasing#asahi · 2022-02-25 09:29
kode54and it can support subtracting a subrange block from one of them#asahi · 2022-02-25 09:29
kode54an NSArray of classes containing NSData blocks#asahi · 2022-02-25 09:28
kode54meet my music player, that does NSData block appends and subrange selections and deletions nonstop as the audio buffering mechanism#asahi · 2022-02-25 09:28
kode54and that's only if you're doing a dumb and allocating and freeing nonstop#asahi · 2022-02-25 09:27
kode54only case I can see is maybe MSVC runtime, where malloc/free cycles are horribly suboptimal#asahi · 2022-02-25 09:27
kode54I have yet to see any usage scenario where I even need a custom memory allocator#asahi · 2022-02-25 09:26
kode54what the fuck kind of galaxy brained "optimizations" do they think they're doing#asahi · 2022-02-25 09:26
kode54"Page size is baked into various data structures at compile time"#asahi · 2022-02-25 09:26
kode54chadmed: what the fuck#asahi · 2021-12-21 02:09
kode54the only other reader I have on hand is a 5.25" bay mounted thing that plugs into 3.0, and it's so buggy that it frequently disconnects itself at random#asahi · 2021-12-21 02:08
kode54it seems really slow, so it's probably a stinking 1.0 device#asahi · 2021-12-21 02:08
kode54the multi card reader, I can't tell if it's 2.0 or 1.0#asahi · 2021-12-21 02:08
kode54then a 2.0 hub in my secondary monitor, connected to another port on the first one#asahi · 2021-12-21 02:07
kode54that also has both 3.0 and 2.0 topology, depending on what's plugged into it#asahi · 2021-12-21 02:07
kode54then a switchable 3.0 hub with its upstream ports connected to both that first hub, and to my Ryzen desktop that I mostly use headless#asahi · 2021-12-21 02:07
kode54marcan: I have three hubs. The one connected directly to the Mac mini is a 3.0 hub, optionally powered, and its topology shows that there's both a 3.0 and 2.0 hub attached directly to the system by it.#asahi · 2021-12-20 09:36
kode54I find I can't attach a 2.0 device with an internal hub to that second hub#asahi · 2021-12-20 09:36
kode54and another 3.0 hub attached to that one that has the same deal#asahi · 2021-12-20 09:35
kode54what does the tiering thing mean if I'm using: a 3.0 hub that manifests as two separate hubs on attach: a 3.0 hub and a 2.0 hub#asahi · 2021-12-20 09:30
kode54thanks#asahi · 2021-12-20 09:29
kode54is it not widely known now that the M1 and friends can only nest hubs two levels deep beyond their external ports before devices just won't talk with it?#asahi · 2021-12-20 09:28
kode54I can't find marcan's tweet about USB hub nesting