Re: count2.asm
- From: "wolfgang kern" <nowhere@xxxxxxxxxxx>
- Date: Wed, 27 Jul 2005 18:24:27 +0200
Hi Frank,
[about..]
I still think the table solution is fastest,
but as you now added the word count, I'd try this:
esi= start
ecx= size
xor eax,eax
xor ebx,ebx
xor edx,edx
loop:
mov al,[esi]
inc esi
; lodsb
cmp al,20h
jnz next
inc ebx ;dword [words] ;the first space only
spaces: ;count spaces apart
inc edx ;dword [charcount+eax*4]
inc esi
dec ecx
jz show_results
cmp [esi-1],al ;already incremented once above
jz spaces ;skip consecutive spaces
next:
cmp al,80h
jae loop
inc dword [charcounts** + eax * 4]
dec ecx
jnz loop
show_results: ;(later yet)
mov [words],ebx
mov [spaces],edx ;or [charcount+080],edx
....
Ok, here sbb, cmov and setcc wont help much.
[about 32-bit at once and shifts]
It may exceed page/file-end easy, text is rare to be dw-aligned ;)
Yes, Intel-shifts are slow (IIRC until P6).
[about HD read time]
Why not load just as many bytes to almost equalize the load-time
with the analysing time and then add all the partial results.
So while your code is working on the first buffer, the disk fills
the second, and opposite ...
Oh Sorry, I forgot:
neither windoze nor Lindonix are aware of hardware or code timing :)
So you may need to 'manually' check and adapt the best block load size.
__
wolfgang
.
- References:
- count2.asm
- From: Frank Kotler
- Re: count2.asm
- From: Alex McDonald
- Re: count2.asm
- From: Frank Kotler
- count2.asm
- Prev by Date: Re: count2.asm
- Next by Date: Re: HAY Betov, still no support for GPL or LINUX, WHY ????
- Previous by thread: Re: count2.asm
- Next by thread: Re: count2.asm
- Index(es):
Relevant Pages
|