matrix multiplication code optimization - Page 2

matrix multiplication code optimization

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

Just rip the crashreport code out, you don't need it - it is already #ifdefed because another crash reporter is used on MinGW.
el_matarife
Posts: 933
Joined: 27 Feb 2006, 02:04

Post by el_matarife »

I looked into the Via issue last time SSE support came up. Apparently they've had SSE on their chips for a while now. Also, the newer C7 .09μm chips support SSE2/3 too, and even have an eye-popping fast FULL SPEED FPU. (Okay I had to joke about their FPU stuff since I haven't had a PC since the 486 days without a built in FPU) I think the real question is how many people do we have running pre-XP Athlons since Via processors are extremely rare by all indications. The only time I've ever seen them used has been in case modding competitions.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Is it really worth holding us all back so we can support a 0.01% minority?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Is it really worth discussing something that will give a 0,01% speed difference?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Are you referring to the matrix calculation optimization or SSE math?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Both if it applies to matrices, although I agree a SSE float3 might speed things up a bit. But that might just be impossible to get right with sync in mind.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

Spring seems pretty GPU bound to me anyways, tbh, and I have a 6800 Ultra.
User avatar
MadRat
Posts: 532
Joined: 24 Oct 2006, 13:45

Post by MadRat »

The display of the game is GPU bound, the gameplay will always be more CPU bound.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

I don't think I've ever seen my CPU spike above 50% in game, even with tonnes of units.
monohouse

Post by monohouse »

SSE clients don't work with SSE clients ? I thought the problem was with 387 and SSE client, why is sync a problem in case SSE clients play with SSE clients ? isn't that why the compile option exist so that SSE could be used in those cases ? althought after I have tested, compiling with gcc 4.2.0 using SSE mode did not give any improvement, but the testing was not extensive enough to fully determine that, and according to the manual of the math library used, it may happen that SSE is not generated because gcc falls back to 387 silently, don't know if this been fixed in gcc 4.2.0 or other versions, but whether it did change or not, a 20 fps boost is unlikely, and with my recent research on spring performance, I managed to get just that, although under certain circumstances, the minimal improvement was also significant, but the fps reduction is not the main concern, the game speed reducing is the main problem, maybe spring precision could be reduced to 16-bits to remove all those compatibility problems with sync and math ?
IMSabbel
Posts: 747
Joined: 30 Jul 2005, 13:29

Post by IMSabbel »

LordMatt wrote:I don't think I've ever seen my CPU spike above 50% in game, even with tonnes of units.
Concrats.
You have
a) a dual core cpu
and
b) nicely shown that Spring also isnt multithreaded, thus even more cpu limited.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Um, I have an Athlon XP single-core processor, 2800, and I only see the CPU go over 50% when I'm playing NanoBlobs and it's a full-on all-out war, and I and an AI are sending pathing instructions to a thousand units, plus hundreds of particle systems, plus tens of thousands of COB instructions, plus... etc.

In the project I'm working on now, which features slower, more traditonal gameplay, I very rarely see CPU use go over 10%, even with FOUR players, 3 of which are AAI. It only tops 30% or so during the most massive battles. FPS still occasionally dips a bit, even on my 7800 card, but only a bit- it's never unplayable.

It's not that the occasional massive spikes in CPU activity due to waypoint commands and the scripting system and other crap aren't a problem... it's that it compounds the ability of Spring to send more data to the GPU during that frame, I think. At any rate, any amount of CPU optimization should be incorporated, if it's a simple grep-parser fix like this one, frankly. Little bits help a lot when you remember that each little bit is being done a lot of times per frame.

All that said... quit whining, all of you people using computers that are more than 3 years old. My machine is getting to be slow, by today's standards, and I will be upgrading soon. You guys with even worse hardware just need to upgrade, period. A machine with specs better than mine on everything but the graphics card is CHEAP.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

IMSabbel wrote:
LordMatt wrote:I don't think I've ever seen my CPU spike above 50% in game, even with tonnes of units.
Concrats.
You have
a) a dual core cpu
and
b) nicely shown that Spring also isnt multithreaded, thus even more cpu limited.
Phail. I have an Athlon 64 4000+ single core CPU.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

LordMatt wrote:
IMSabbel wrote:
LordMatt wrote:I don't think I've ever seen my CPU spike above 50% in game, even with tonnes of units.
Concrats.
You have
a) a dual core cpu
and
b) nicely shown that Spring also isnt multithreaded, thus even more cpu limited.
Phail. I have an Athlon 64 4000+ single core CPU.
Argh how do you have an Athlon XP with that kind of graphics card? I was under the impression that all the new cards were PCI-Express only.
User avatar
mehere101
Posts: 293
Joined: 15 Mar 2006, 02:38

Post by mehere101 »

The 7800 is the highest AGP card NVidia still produces IIRC.
el_matarife
Posts: 933
Joined: 27 Feb 2006, 02:04

Post by el_matarife »

It may be worth testing some CPU optimizations to see if they can improve Spring's performance. If SSE could improve performance on the lower end P3 and Athlon XPs some people play with it'd definitely be worth it. I think the other big situation where Spring is CPU bound is heavy terrain deformation and large amounts of corpses that seem to really slow pathfinding. I've also heard complaints about performance with wind generators and the particles from mass nanolathing. The wind generator & nanolathing code could probably have some serious CPU optimizations since it shouldn't be synced code right?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

nanoparticles yes, wind generator no. The wind generator I assume is either the wind generator unit or the wind strength code, which needs to be synced as it affects resource generation which is a huge game rule component.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

The resources taken by the wind generator are negligible anyway, it's just one random number between minWind and maxWind that changes every now and then, probably with some interpolation in between.

Also if someone wants to test performance sure go ahead, but I can tell you in advance that the difference (if any) won't really be objectively noticable by a human so you'd need to write instrumentation code first and run the test multiple (many) times to average out variation because of the multitasking nature of your OS.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

As for proc usage, I have a single core amd64 3800+

I have yet to see it go over 32% usage.

On a reasonably high end pc spring runs like hot sex. Now of course maybe spring doesn't run as well as it could, but hell, it's not THAT bad... Unless you're playing on your moms dell, in which case, that machine prolly had no business running spring in the first place.

I don't understand why people come to OS games and then wonder why their crappy PC doesn't run it very well. Well geez, open source devs like things to look good too. Shocking.


@Matt Motherboards are made for that proc taht support PCI-E, unfortunately all a high end gfx card like that does is transfer the bottleneck to the cpu.
tombom
Posts: 1933
Joined: 18 Dec 2005, 20:21

Post by tombom »

There's still no real reason not to optimise Spring if you can. My computer is about 3 years old and runs Spring fine even with 50 tabs open in firefox and me constantly alt-tabbing though.
Post Reply

Return to “Engine”