Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 May 1997 19:15:55 -0500
From:      Wm Brian McCane <root@bmccane.uit.net>
To:        Brett Glass <brett@lariat.org>
Cc:        hardware@FreeBSD.ORG
Subject:   Re: isa bus and boca multiport boards 
Message-ID:  <199705250015.TAA13757@bmccane.uit.net>
In-Reply-To: Your message of "Thu, 22 May 1997 18:12:07 MDT." <3.0.1.32.19970522181207.0072d920@lariat.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> At 09:47 AM 5/22/97 -0700, Jim Shankland wrote:
>  
> >This "tuned asm" thing is perilously close to an urban myth, anyway.
> >To the extent there's any "lift" to be gotten from asm at all, it's
> >from tiny little pieces in performance-critical inner loops, 
> 
> Exactly. The guts of the sio driver ARE some performance-critical inner loops.
> 
> >especially
> >if there's a hardware-specific instruction that the compiler won't
> >generate.
> 
> I'd have to look at the generated code to see how well I/O is done. But
> I'd HOPE that the macros do the right thing.
> 
> >It's one thing to say, "I've just spent 3 weeks of backbreaking labor
> >tuning the sio driver, and made it X% faster; then I experimented and
> >found that, by replacing the following N lines of C code with assembler,
> >I made it Y% faster still"; and another to wave one's hands about
> >a fast sio driver written in assembler.  Given the costs in portability,
> >maintainability, and effort required for assembler, arguments for its
> >use must be supported by strong, empirical evidence of benefit.
> 
> My experience on other OS platforms dictates that there IS a large measure
> of efficiency to be gained -- on the order of 25% time savings. The
> improvements are partly from ASM and partly from good algorithms.
> 
> --Brett
> 

Tuned asm can be VERY useful.  I wrote a program recently to crack PKZIP 
passwords for my wife (she forgot one 8-).  On a test zip I created, my `C' 
version of the header checksum code took 7 minutes to crack a 4 character all 
uppercase password.  I then flattened the algorithm to not use recursion, 
which reduced it to about 5 minutes.  After writing my assembler version of the 
routine which did all the obvious things, (used registers for each key, one 
more for temporary, no unavoidable register loads, etc), the new version only 
took 2 minutes.  Unfortunately her password was 8 characters (alpha and 
numeric), and took DAYS to crack.

	brian

BTW> A cheap M$ slam.  I compiled a console program under MSVC++, including 
     inline assembler for the header computation, it took 22 minutes to 
     crack the test file 8).





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705250015.TAA13757>