Is Max slower

BlitzMax Forums/BlitzMax Programming/Is Max slower

H&K(Posted 2007) [#1]
http://www.deviantmachine.com/link/sieve.zip

Please download the sieve Test, re-name the MaxTest to somethinge else "Max Sieve2.exe" for example, then rebuild the test from the sorce.

Are they the same speed?

On mine, when I compile it, its concistantly 5% slower no matter what settings. Does this mean that Bmax is now 5% slower than march 2006?


dmaz(Posted 2007) [#2]
hmmm. I get 25% slower and a lot bigger.

old - 1768
new - 2227

size:
old - 21.5KB
new - 81.0KB


plash(Posted 2007) [#3]
More features being added to modules and whatnot explains the size, but not necessarily speed.


degac(Posted 2007) [#4]
old - 4175
new - 4522

size:
old - 21,5 KB
new - 81 KB

Athlon64 3500+ WinXP Pro sp2, Max 1.24


iprice(Posted 2007) [#5]
We need support for the latest mingw in the next version. There are many optimization which can't be used with BlitzMax because of that.


Gabriel(Posted 2007) [#6]
About 33% slower here, which would be a huge discrepancy if it held true in broader tests.

Old one : 2482
New one : 3265

Did we change FASM versions in there somewhere?

We need support for the latest mingw in the next version. There are many optimization which can't be used with BlitzMax because of that.

Sure, but that's completely irrelevant to this test.


Azathoth(Posted 2007) [#7]
Anyone noticed how slow the purebasic one is?


H&K(Posted 2007) [#8]
About 33% slower here, which would be a huge discrepancy if it held true in broader tests.
True, but as this bechmark has been often towted as a trueish comparison of the different Languages, (That why I downloaded it), it must hold that its still a trueish comparison of the BMax versions.

If you have some more General tests, and still have older Bmaxes knocking about, could you run some tests?


tonyg(Posted 2007) [#9]
Old Max : 4406 , size 21.5
New Max 4397, size 81kb


xlsior(Posted 2007) [#10]
Old: 2419
New: 3053

(using latest MinGW)


Gabriel(Posted 2007) [#11]
True, but as this bechmark has been often towted as a trueish comparison of the different Languages, (That why I downloaded it), it must hold that its still a trueish comparison of the BMax versions.

Well it might, depending on how accurate the people doing the touting were. I can't say as I've spotted a similarly massive drop in the speed of my game project, but I haven't been monitoring the old FPS counter too fanatically, so it's possible. I'd certainly like to see some more tests if indeed anyone does have an old version.


dmaz(Posted 2007) [#12]
how did tonyg get faster?


H&K(Posted 2007) [#13]
how did tonyg get faster?
I think its safe enough to say 4406 and 4397 are statisticly the same. But yep, how come I wonder?


MGE(Posted 2007) [#14]
Old: 5177
New: 5914


TomToad(Posted 2007) [#15]
I think it might be related to the GC. I was able to get much faster execution just by moving the Local declarations outside the loop.
Possibly the older MAX has a faster GC?

original 4716ms 22K
New 4786ms 84K
Locals outside of loop 4004ms 84K


Dreamora(Posted 2007) [#16]
No the older Max has a worse handling of local scope which might be the reason for this behavior. It was optimized to give the "i want control over memory usage" yellers more control.

But makes sense that a local outside a loop is by far faster as it does not enforce cache reaction on every loop iteration (as locals go into cpu registers)


Gabriel(Posted 2007) [#17]
I just tested with the locals moved and got 3065, still 25% slower than the old versions of Blitzmax with the locals *inside* the loop. Even assuming that the old version would not be any faster with the locals moved outside the loop, that still leaves a pretty huge 25% speed loss unaccounted for.


Dreamora(Posted 2007) [#18]
Are you on a stoneage AMD with 256kb Cache or a P4?


Gabriel(Posted 2007) [#19]
No, I'm on an Intel Core Duo 6600 ( you probably could have surmised I'm not on an ancient machine, since my numbers are lower than everyone else but two. )


Dreamora(Posted 2007) [#20]
1. Don't see why this should be a GC issue at all, as the GC isn't used at all (only ints are used, they are not reference handled)
2. The main difference between old and new blitz is that the new one has modified math code. Thats the reason that people with newer MingW versions should most likely outperform all with stock BM and MingW 3.1

My times:

Old: 2050 (+- same as C++)
New: 2450 (+- same as C#)
the rest is 5 seconds upward

Core 2 Duo E6600


H&K(Posted 2007) [#21]
I was able to get much faster execution just by moving the Local declarations outside the loop
I did all of that messing about trying to speed it up by moveing things before I posted the question. And yes it is faster moving the loacal declarations arround, but without a previous Bmax to test it on, I had to assume that it would also make that version faster.

Also, Im willing to say that 4716 and 4786 are the same speed anyway.

Apart from TomToad and TonyG, both of whoms test speeds can be called "Equivalent", everyone has a slowdown on the present version compared to the older version, rangeing from 5% to 33%, and even after optimising the Variable allocation on the newer version its still slower on the ones its slower on.

So
1) What version of Bmax is the original test from? Anyone know how to find out.
2) What Machines are Tonyg and TomToad using?

TonyG WinXP SP2, Athlon 2700+, 9800Pro, 1G Ram


simonh(Posted 2007) [#22]
Old: 7600

New: 8755

New New: 7729

Looks like Mark's already addressed this (and yes my computer is slow!).


MGE(Posted 2007) [#23]
What's the "New New" version?


LarsG(Posted 2007) [#24]
I was about to ask the same?

is it the upcoming update?


Dabz(Posted 2007) [#25]
Probably the next update.

Dabz


degac(Posted 2007) [#26]
And for Mac/Linux someones has old version to compare? Only for curiosity...


simonh(Posted 2007) [#27]
New New = latest dev version.


SebHoll(Posted 2007) [#28]
New New = latest dev version.

Speaking of which, anyone know when the new update to BlitzMax is coming out? Simon? Mark?


TeraBit(Posted 2007) [#29]
2346 - c#
2515 - C++
3063 - OldMax
3435 - NewMax
7578 - Blitz3D
7609 - pb

Interesting line up. Glad to hear the next version is getting a re-boost. :)


TomToad(Posted 2007) [#30]
I still have a copy of Max 1.12 installed and I got 4945 ms with a compile size of 49K, which is about 200ms slower than 1.24

Interesting, I wonder just which version is actually used for their test.

System:
ASUS A7N8X motherboard
AMD Athalon XP 2800+ 2.1Ghz
512 meg Ram
NVidia Geforce FX5200


Orca(Posted 2007) [#31]
Hmmm I just noticed the url for that test.

I thought I had left a readme in the zip but I guess not :/

I grabbed the c++ and max version from someone else's test. Can't remember who, but I'm sure a search on here will find the original thread and author. No clue on the c++ compiler used( assume its either vs or gcc ). I seem to recall having someone from #blitzcoder compile the blitzmax version for me.

I know for sure I ported the c# version( from the c++ one ), and compiled it with the microsoft c# 2.0 compiler.

I'm 99% sure I did the purebasic version as well( unless I'm going crazy ). It was compiled with pb 3.93. It would be good to recompile it, since purebasic's gotten some big updates. I'd do it myself, but I've lost my registration details, and my email to get my account sorted was ignored :)

Theres a freebasic version, but I guess it didn't make it in that zip. Stonemonkey ported it and compiled it. I don't know if I still have that. From what I remember, it came in about mid-pack.


marksibly(Posted 2007) [#32]

Speaking of which, anyone know when the new update to BlitzMax is coming out? Simon? Mark?


Next week-ish, all going to plan.


MGE(Posted 2007) [#33]
Is there anyway to know what has been changed / dropped / added in the new version?


TeraBit(Posted 2007) [#34]
I'm 99% sure I did the purebasic version as well( unless I'm going crazy ). It was compiled with pb 3.93. It would be good to recompile it, since purebasic's gotten some big updates. I'd do it myself, but I've lost my registration details, and my email to get my account sorted was ignored :)


Recompiled the PB source under the latest PB. Exactly the same results.


Derron(Posted 2007) [#35]
Tested like you said: moved locals out of loop, changed (think only visually) "prime = prime + 3" to "prime:+3" and so on.


' BlitzMax sieve test

Framework BRL.StandardIO
Import BRL.System

GCSetMode 2

Const ITERATIONS:Int=50000

Print "SIEVE OF ERATOSTHENES - "+ITERATIONS+" iterations"

Global t:Int=MilliSecs()
	Local flags:Int[8191] , i:Int, k:Int, prime:Int
	Local Count:Int = 0
	Local Iter:Int = 1
For Iter = 1 To ITERATIONS
	i = 0
	k = 0
	Count = 0
	
	For i = 0 To 8190
    	flags[i] = 1
	Next

	For i = 0 To 8190
		If flags[i]=1
			prime=i+i
			prime:+3
			k=i+prime
			While k <= 8190
				flags[k] = 0
				k:+prime
			Wend
			Count:+1
		EndIf
	Next

	GCCollect

Next

t=MilliSecs()-t
Print ITERATIONS+" iterations took "+t+" m/secs."
Print "Primes: "+Count
Input "Return to end ..."
End



on my crappy amd 1700xp:

old: 6440
new: 5483

new = all update up to august, most recent fasm, normal (old) mingw.

bye
MB


H&K(Posted 2007) [#36]
Well thank you MichealB, but as was pointed out before, this was pointless, unless you have the olderversion of Bmax, and can compile the optimised version on that.


Dreamora(Posted 2007) [#37]
We all have an older version. Its called BM Windows Demo and its 1.12. Much older than stoneage isn't possible.

But aboves changes don't make much, even if you replace i+i with (i shl 1)


H&K(Posted 2007) [#38]
We all have an older version. Its called BM Windows Demo and its 1.12.
And we know that that isnt the one that the old example was compiled on, because Tom already compiled the program on it, and found it slower than the precomiled example in the download.

We are not saying that the older the version the faster it is, but rather there was a sweet point. And that it doesnt matter what you do to optimise it now, the sweet point program would also need to be optimised for comparison.


Derron(Posted 2007) [#39]
Just wanted to say that the new one finishs faster than the provided application in the first post...

That you can't really compare coz of the done changes in sourcecode is known to me.


But to help:
Exe-File is dated to march 2006.
First Version including GC is v1.12 ?! (v1.09 doesn't know GCSetMode 2)

Think it should be v1.14 (would fit to the date) - will test it when have the next sparetime ;D.


EDIT: argh, its not v1.14 ... filesize 50kb, speed about the same.

bye
MB


iprice(Posted 2007) [#40]
I'm curious what other new features the coming release will have...


Derron(Posted 2007) [#41]
Ok... filesize wont help much when it comes to comparison, just had a look into the old exe file ... it got upx-compressed.

So stripped and compressed will change a lot.


EDIT: ok. uncompressed it ("upx.exe ExeFile -d") and voilą: 50kb. I don't know if my fasm or mingw isn't the same, but 'only' 2-3kb of the old file are different to mine of blitzmax 1.14. May be we narrowed the options down to 1.14-1.16.

bye
MB


H&K(Posted 2007) [#42]
@Michael, it might be a doomed exercise, because all the Mod updates that may or may not have been added to the one in the zip file. Its even possible that the Zipped on was made with a version of Bmax that was sycned in the AM had something wrong with-it that made it faster, and was re-synced in the after-noon with a corrected version without the error but hence slower.

All I wanted you to realise (which you have said you did anyway), was that it wasnt a question of opimisation.

My personal Vote for the reason, is that the GC was changed/improved which resulted in better and faster auto GC but slower manual GC, as this would explain why ppl with a massive 33% slower wouldnt notice it as much.


Grisu(Posted 2007) [#43]
Will bmx magui also get an update?