Article View: borland.public.delphi.language.objectpascal
Article #32412Suggestions for a faster algorithm?
From: Anthony T.W.
Date: Sun, 24 Nov 2002 21:53
Date: Sun, 24 Nov 2002 21:53
16 lines
1653 bytes
1653 bytes
I am trying to parse "words" from binary files based on my set of rules, where allowable word characters are in a constant, so characters of 'A'..'Z' are okay characters for words. It will check each byte of the file and peice the letters into words... Does that make sense? Anyways, the method I am using is really slow. It takes about 2 minutes to process a 704KB file, when the the files it needs to process are usually around 1.5MB, and there are a few of them. You can see where this could pose a problem. :P Right now, I use TFileStream.ReadBuffer to read each character, then I check the character, then go to the next on. Is there a better way? -- Anthony Wertz (aka Anomy) Webmaster, RPG Infinity http://rpginfinity.com
Technical Details
Message-ID:
<3de14abc$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109d30,4492917324c52112,start X-Google-Attributes: gid109d30,public X-Google-ArrivalTime: 2002-11-24 14:15:38 PST From: "Anthony T.W." <anomyw3@hotmail.com> Newsgroups: borland.public.delphi.language.objectpascal Subject: Suggestions for a faster algorithm? Date: Sun, 24 Nov 2002 16:53:09 -0500 Lines: 18 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 65.32.84.194 Message-ID: <3de14abc$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1038174908 65.32.84.194 (24 Nov 2002 13:55:08 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail