free xp speedup (l2 cache setting) 1 .. 5%

For everything that's not in any way related to PureBasic. General chat etc...
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

free xp speedup (l2 cache setting) 1 .. 5%

Post by blueznl »

it all depends on your system, but with a little tweak you can get a little more performance on xp and win2k, see here for a little more detail:

http://www.xs4all.nl/~bluez/datatalk/lowgo.htm#l2_cache
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
TheBeck
User
User
Posts: 39
Joined: Mon May 12, 2003 6:04 am
Location: the far west
Contact:

Post by TheBeck »

:roll:

CPU cache is hardware level not OS level, it doesn't matter what windows thinks it is, it is all still used.
Nathan Beckstrand -- XPSP2, AMD Athlon XP 3000+, GF2 GTS, 512MB RAM
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

you are totally right, and yet i've tried it on three machines, and it worked on all three... even though even microsoft says it shouldn't work (follow the link through to the microsoft article)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
TheBeck
User
User
Posts: 39
Joined: Mon May 12, 2003 6:04 am
Location: the far west
Contact:

Post by TheBeck »

The only thing I can think of is maybe windows does different optimizations based on how much cache it detects...
Nathan Beckstrand -- XPSP2, AMD Athlon XP 3000+, GF2 GTS, 512MB RAM
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> CPU cache is hardware level not OS level

Hmm, the link states: Windows XP and Windows 2000 have some troubles
detecting the CPU's L2 cache.
Changing the Registry setting forces Windows
to see it. I made the following code into an exe, and then tested it (after
booting into Safe Mode both times), with the following result:

Default Registry setting of 0 = 1800 ms (on average; 10 runs performed).
Registry setting set to 1024 = 1650 ms (on average; 10 runs performed).

So, having the setting at 1024 for the L2 cache (as opposed to the default
of 0 on my machine) has definitely sped up the code below. I know some
of you may say that a loop test is useless, but the fact remains that the
loop is sped up, so I see no harm in leaving the Registry at 1024 just in
case it somehow does help in speeding up something else. ;)

Code: Select all

start=GetTickCount_()
For r=1 To 200000000 : Next
MessageBox_(0,Str(GetTickCount_()-start),"",0)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
TheBeck
User
User
Posts: 39
Joined: Mon May 12, 2003 6:04 am
Location: the far west
Contact:

Post by TheBeck »

PB:
It's ironic, your code only uses a few kb of cache at most, so it wouldn't matter what windows thinks it is. This just isn't logical to me. :roll:
Nathan Beckstrand -- XPSP2, AMD Athlon XP 3000+, GF2 GTS, 512MB RAM
Post Reply