Speed 3D Engine,

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
yodathegreat
Posts: 9
Joined: Tue Dec 26, 2006 12:16 am

Speed 3D Engine,

Post by yodathegreat »

Hi all,

I have try some 3d Engine, Irrlicht, TV3D, Crystal etc.

but why some procedures don't be write in Assembler ??

Some Functions are very(very) slow.. and the conversion in assembler is benefic ?

With a profiler we can extract the slow fonction and re-write it in assembler ? NO ?

Best regards
Yodathegreat
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

You could write code in assembler. Unfortunately if you do that then the code becomes much less portable and maintainable. Not everyone can read and write assembly these days.

Another problem is that a block of code that may be performance critical for your program may not be performance critical in someone elses application. The best bet is to write your application. When you're done, run a profiler to find out where the hotspots are and optimize those areas.

The biggest reason to _not_ start writing assembler routines is because you don't need to. There are many other optimizations that can be implemented to drastically improve performance.

Travis
playerdark
Posts: 64
Joined: Mon Aug 01, 2005 5:06 am

Post by playerdark »

the biggest argument against assembler in my eyes is that these days it is nearly impossible for regular guys like us to understand all the conditions in assembler that create punishments for acessing registers, memories or commands in an order that was not intended by the CPU developers.

Modern compilers mostly optimize better than most of us could do in assembler.
HLFat
Posts: 71
Joined: Sun Sep 24, 2006 6:55 pm
Location: USA

Post by HLFat »

I don't know, but if you want to jump into assembler and windows, I suggest GoAsm.

Don't think it would work with Irrlicht ,but heck, what do I know.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

maybe yoda has a point if a really slow internal function that is unlikely to be altered anytime soon is changed into assembler. (And we can still provide the ordinary C++ code for it so it wont make a difference in portability or opensource ness.) Again this would be a function that is frequently used, slow, and such an integral part of the engine that it is unlikely that anyone would want to modify it (And we still provide C++ code if they have to). What do you guys think?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I guess that there are enough libraries which would bring their own implementations of that stuff alredy. Take the Intel libraries as an example. They have useful stuff (such as all kinds of math, image handling, etc) all optimized in the library. You probably won't get much further without becoming too specific. And I really doubt that there is anyone here who writes efficient assembler code for all kinds of x86 platforms with all vector code add-ons like SSE2/3 and hopefully also x86/64 which works for all compilers on the market and is faster then what these compilers produce with optimal settings.
Even the software drivers are working without such manual assembler tuning and I think it's a good idea to leave it like that. But hey, if someone finds some really good example and shows working code - why not.
Post Reply