Same loop, same numbers, 11x slower
Youtube
0:52
226 views
ZetBit
@UC3zY4m_LrHraxTCv-lFPPIg
I added up the same 16 million numbers twice with the same loop. In order it took 9 ms. In random order it took 96 ms. The CPU fetches memory in 64-byte blocks and prefetches the next one when you walk forward, so random reads end up waiting for main memory (about 90 ns per read in my test, versus about 1 ns from the closest cache).
#programming #performance #gamedev #shorts
More Videos

0:11
My Father's prettiest son
Sallie Grace
663 views

1:01
Same code, 7 meters at 30 FPS and 67 cm at 300
ZetBit
16 views

0:17
Happy relationships in Eastern Europe 👩❤️👨 #easterneurope
Violet_Myr
951 views

3:00
So many car brands 🥴🤣🚙🚗!!
Jimmy Rees
12K views

0:12
#shorts
Wofi kingdom
930 views

0:07
I am Limited edition
Sallie Grace
971 views