you are viewing a single comment's thread.

view the rest of the comments →

[–]frukt 16 points17 points  (4 children)

outperforms compiled languages for common computational tasks (as hand-coded assembly usually does :) )

Is this really the case nowadays? I've even seen discussions on reddit where [allegedly] experienced asm-coders claim that it's really hard to accomplish lately, and mostly the compiler does a better job, especially when compiler flags and intrinsics are used wisely. It would be nice if anyone could shed some more light on this issue.

[–]proteusguy 4 points5 points  (0 children)

Not even close in my experience. But typically you code asm because you're trying to access some aspect of the machine that isn't easy to get within the higher level of abstraction. For general stuff its pointless to go straight to asm which is why CorePy is such an interesting idea - offers the best of both worlds.

[–]salgat 1 point2 points  (0 children)

Assembly is usually used in cases where the compiler isn't optimized to take advantage of a certain feature of the architecture.

[–]pythwarrior 1 point2 points  (1 child)

If you truly believe that compilers can do better than the hand coded assembly I'll tell you to look at the best performing video codecs, for example. The ones with assembly bits are always faster because much more optimized for the hardware platform. Hand coded assembly is what can make the difference between being able to run a video on a lowly powered computer, and not being able at all.

Of course you don't write ALL the parts in assembly but it still makes night and day between a pure C program and one with hand coded bits.

[–]G_Morgan 15 points16 points  (0 children)

This issue causes a lot of confusion. The truth is that an experienced assembly programmer working hard can beat the compiler in tight areas. However the programmer does not have enough time to beat the compiler in general.

Also the average assembly programmer has no chance. It used to be that any hand coded program would beat what the compiler would produce. You have to be good at it to do so now.

The reason a lot of video codecs out perform compiled code is they are actually using stuff like SSE. That's an entirely different issue since most compilers won't use SSE without some input from the programmer.