Article View: borland.public.delphi.language.objectpascal
Article #32417Re: Suggestions for a faster algorithm?
From: Uffe Kousgaard
Date: Sun, 24 Nov 2002 22:07
Date: Sun, 24 Nov 2002 22:07
30 lines
2079 bytes
2079 bytes
You should read at least chuncks of 1024 bytes into a buffer and then read the characters from there. That will have a big effect. "Anthony T.W." <anomyw3@hotmail.com> wrote in message news:3de14abc$1@newsgroups.borland.com... > 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:
<3de14d62$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-mailReferences:
<3de14abc$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109d30,4492917324c52112 X-Google-Attributes: gid109d30,public X-Google-ArrivalTime: 2002-11-24 14:15:38 PST From: "Uffe Kousgaard" <uffe@routeware.dk> Newsgroups: borland.public.delphi.language.objectpascal References: <3de14abc$1@newsgroups.borland.com> Subject: Re: Suggestions for a faster algorithm? Date: Sun, 24 Nov 2002 23:07:04 +0100 Lines: 31 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4920.2300 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4920.2300 NNTP-Posting-Host: 62.242.60.210 Message-ID: <3de14d62$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1038175586 62.242.60.210 (24 Nov 2002 14:06:26 -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