[pacman-dev] Crypto algorithms

Roman Kyrylych roman.kyrylych at gmail.com
Tue Apr 10 10:58:12 EDT 2007


2007/4/10, Jason Chu <jason at archlinux.org>:
> On Tue, Apr 10, 2007 at 02:09:19PM +0300, Roman Kyrylych wrote:
> > 2007/4/10, Nagy Gabor <ngaba at petra.hos.u-szeged.hu>:
> > > > :S maybe i did something wrong at asmutils compile, but seems it is
> > > > not faster :S its slower.
> > > >
> > > Yes, I also found that asmutils is slower.
> > > (asmutils: OS = LINUX, KERNEL = 26, OPTIMIZE = SPEED, SYSCALL =
> > > KERNEL vs. coreutils 6.9-1 standard i686 AL package)
> > >
> > > asmutils:
> > > ---------
> > > real    0m1.473s
> > > user    0m0.734s
> > > sys     0m0.302s
> > >
> > > coreutils:
> > > ----------
> > > real    0m1.103s
> > > user    0m0.194s
> > > sys     0m0.035s
> >
> > This means that asmutils use slower algorithm.
> > The _same_ code written in C and assembler cannot be slower in
> > assembler by definition.
> > One cannot made C code faster by _just_ rewriting it in assembler, but
> > assembler allows better processing using internal registers, and
> > easier use of MMX/SSE/etc.
> > Correct use of assembler (not just "let's rewrite it in asm because
> > it's faaaast!!!") does make code faster.
>
> Some people argue that compilers can do a much better job of register
> allocation and code optimization than people can.  I believe in most
> non-trivial cases they're probably right.

"compilers can .... better ... than people can".
Sure, they _can_, but it depends on programmer.
I guess nobody will argue that good programmer can beat compiler
automatics, because he _knows_ what he _needs_ while compiler
_"quesses"_. :-P
Also I think when all code is written in C but some parts in asm, in
most cases authors did know what they are doing and why.
Anyway back on topic.
To me, Dan's idea to use beecrypt seems like a good idea.

-- 
Roman Kyrylych (Роман Кирилич)


More information about the pacman-dev mailing list