Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Alternatives to sed + awk



On Thu, 10 Mar 2011 09:29:32 +0100
Josh Glover <jmglov@example.com> wrote:

> On 10 March 2011 08:38, Attila Kinali <attila@example.com> wrote:
> > Another thing is if you are doing high performance stuff where you
> > use each and every feature of your CPU. Have a look at libraries
> > like lavcodec which contain an increadible amount of hand written
> > assembler code.
> 
> Sure, but that is certainly one of the special cases to which I
> alluded earlier in this thread. I assume that lavcodec was profiled
> and hand-optimised, right? Or did the developers (aren't you one?)
> just know which sections needed to be fast / small enough for
> assembler?

Profiling in the common sense was not done. Cannot be done in
this kind of code. The usual tools that are available for
performance measurement disturb the characteristics of the
code to measure so much, that you basically get random numbers.
What is done instead, a guess on which section might be interesting
for optimization (they are nearly all of the same category) is done.
While writing and optimizing the asm code, a special block before
and after is inserted that counts the cycles used. And in the end
an overall benchmark is done, whether the whole thing did actually
give any performance boost.

> Also, how portable is lavcodec to amd64? PowerPC? Sparc?

For every asm function, there is a prototype written in C.
x86* is very well supported and has the most asm code.
PowerPC has not as much, but enough to run fast. Sparc has
very little asm optimization. Interestingly, the best optimized
architecture after x86* is ARM.

> > But especially if you go to smaller machines, there
> > is no alternative to start directly in assembler. The mentioned PIC16F84
> > is one of those uCs i wouldnt bother using a compiler with.
> 
> That is something I learned from this thread.
> 
> I still stick by my modified statement that you can't regularly beat a
> compiler on any architecture the compiler supports well. :)

The best compiler i've seen out there is gcc. And it doesnt support
any architecture well. Not even x86_32.

				Attila Kinali
-- 
It is the unknown we fear when we look
upon death and darkness, nothing more.
	-- Albus P. W. B. Dumbledore


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links