Re: asm grep



Frank Kotler <fbkotler@xxxxxxxxxxx> wrote in part:
I don't think it's been mentioned in this thread. I'm "aware" of
Boyer-Moore, but I'd have to read up on it before attempting to
implement it...

Well, just a suggestion. I'm not sure it is really the best
algo given RAM/disk high bandwidth and long latency and x86
high CPU speed. Nor for short patterns typically used by grep.

Yeah... I think we need to worry about that last, though. Before
that, probably a better search algorithm - probably Boyer-Moore -
and before *that*, quit reading the file a byte at a time!!!

That is pretty easy -- just do a fixed size read (I'd suggest 512
or 4096 bytes). Then I'd just run a REP / SCASB or CMP AL,[ESI+ECX]
/ JNZ on the anchor. Watch for a match in the block-breaks.


The asmutils concern themselves strictly with size.

This is a very worthwhile goal. Especially useful for
Rescue/Recovery disks. Smaller utils mean more utils
in the typically fixed 2.88 MB ElTorito boot image.

(I should make it clear I'm not calling Konstantin, or other
asmutil authors, "newbies"! The asmutils "are what they are". I
think maybe they may have "gone too far" in this case.)

Agreed. It is a question of values, but I have run `grep`
on a whole disk (!) from a rescue disk. Speed does matter.

-- Robert

.