Thread 105719622 - /g/ [Archived: 814 hours ago]

Anonymous
6/27/2025, 9:29:16 AM No.105719622
03697aeb9c5e6abfd8e42f02af9f3fda
03697aeb9c5e6abfd8e42f02af9f3fda
md5: 2760450328fe0b1f5458ba3d844b10f6๐Ÿ”
I was told struct of arrays was faster than array of structs but its slower when tested it.
Replies: >>105720311 >>105720327 >>105720374 >>105721444 >>105721481 >>105721620
Anonymous
6/27/2025, 9:51:34 AM No.105719752
soatest
soatest
md5: c178a6ee1561a2c4562b6f55ef43e0ee๐Ÿ”
i get a 1000x speedup when the array fits in L1 cache
Replies: >>105719762
Anonymous
6/27/2025, 9:52:35 AM No.105719762
soatest
soatest
md5: 5e27ff95529cb44c722fb69c6b70366e๐Ÿ”
>>105719752
fug wrong pic
Replies: >>105719851 >>105720185
Anonymous
6/27/2025, 10:06:40 AM No.105719851
>>105719762
Now try it when arrays need to be loaded from ram, it slower unless you use SIMD
Replies: >>105719898
Anonymous
6/27/2025, 10:11:59 AM No.105719898
>>105719851
I already proved it's faster why would I make it slower on purpose lmafo
Anonymous
6/27/2025, 10:50:20 AM No.105720146
>posts anime girl picture
>doesnt understand cache
>makes flawed tests
>runs them exactly oncec
>with low resolution timers
>misinterprets results
checks out
all we need from you is a frog picture OP, you'll get 100% /g/ score for this thread
Replies: >>105720165 >>105720374
Anonymous
6/27/2025, 10:52:48 AM No.105720165
2464276436237
2464276436237
md5: 718880b20c25ed23214e3ef7c3f79950๐Ÿ”
>>105720146
Anonymous
6/27/2025, 10:55:38 AM No.105720185
>>105719762
tf you are on windows, mind sharing your dekstop?
Anonymous
6/27/2025, 11:15:01 AM No.105720292
gaymn
gaymn
md5: 5376368406966a7e85f489d5f47a0ba6๐Ÿ”
are you retarded and this is a serious question? in your some_class you have "poop" which is 15 * 4 bytes. this means u have 60 * 1024 bytes that are not doing anything and in some_struct u do not have this. faggot tourists lowering this boards iq by the day. also you probably arent using -O2 compiler optimizations. please never make a thread again.

Captcha
GAYMAN
Anonymous
6/27/2025, 11:17:55 AM No.105720311
>>105719622 (OP)
Dumb tranime poster
Anonymous
6/27/2025, 11:21:05 AM No.105720327
>>105719622 (OP)
Depends on your access patterns and the size of the struct.
The biggest difference is if you use SIMD.
Anonymous
6/27/2025, 11:23:51 AM No.105720343
This is just fucking trivia. Everyone on this thread donโ€™t use this knowledge or even know how to apply it in non-toy problem.
Replies: >>105720375
Anonymous
6/27/2025, 11:28:33 AM No.105720374
>>105719622 (OP)
>>105720146
It truly amazes me what a dead end this board is. I come here every once in a while, just briefly, to see if there's anything interesting in tech news, and consistently all I find is a neverending circlejerk of talentless hobbyists digging the same rut ever deeper in trivial nonsense and insignificant arguments with the only clear message being that their time is worthless. I genuinely believe that any significant amount of time spent here can only result in encouraging one to get mired in the same useless all-consuming rut.
Replies: >>105720402 >>105720412
Anonymous
6/27/2025, 11:28:43 AM No.105720375
>>105720343
yeah, the speedup actually depends on the way you access your data, it can go either way
whats important is that the data is in the order one is gonna access it
Anonymous
6/27/2025, 11:32:11 AM No.105720402
>>105720374
never had to go fast, eh?
thats ok, but dont be a salty asshole about it

op's is a basic consideration when you organize data within a program
he thinks of it in the wrong terms
but its certainly not "hobbyist circlejerk"
Anonymous
6/27/2025, 11:33:12 AM No.105720412
Screenshot 2025-06-27 193253
Screenshot 2025-06-27 193253
md5: a4d692ea576d4016bac773d9508aa2a7๐Ÿ”
>>105720374
Just ban weebs, board quality will increase 10 fold
Anonymous
6/27/2025, 1:57:29 PM No.105721444
>>105719622 (OP)
It's not about that, it's about the memory layout. The exact same array can be faster depending on the order of the elements, important for matrix operations.
Replies: >>105721472
Anonymous
6/27/2025, 2:01:38 PM No.105721472
>>105721444
yeah, its not even a matter of structures and objects
its a matter of order in which a certain data is read vs its layout in memory
an even simpler example would be pixels in an image, and reading them horizontally vs vertically
Anonymous
6/27/2025, 2:02:53 PM No.105721481
>>105719622 (OP)
Realistically, why would there be a difference? The addressing speed should be the same, no?
Or is it something to do with caching or something?
Replies: >>105721532
Anonymous
6/27/2025, 2:09:39 PM No.105721532
>>105721481
theres cache lines
its the smallest unit of information your cpu can request
its 64bytes large
so if you read an image vertically, when theyre stored horizontally
you could see a 16 x slowdown because you will be reading 64 bytes of which you need only 4 for instance
but then theres out of order operations and caching which will dampen the performance hit

so yeah
you want your data to be kept in a similar way its gonna be read, in short
Anonymous
6/27/2025, 2:18:56 PM No.105721620
>>105719622 (OP)
Dogmatic opinions are rarely right