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
Speed 3D Engine,
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
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
-
- Posts: 64
- Joined: Mon Aug 01, 2005 5:06 am
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.
Modern compilers mostly optimize better than most of us could do in assembler.
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?
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
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.
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.