Board index » delphi » Need some suggestions from the experts here, for a fast algorithem :)
desp
![]() Delphi Developer |
desp
![]() Delphi Developer |
Need some suggestions from the experts here, for a fast algorithem :)2007-04-30 04:31:00 AM delphi202 Hello, was wondering if some of you could share your knowledge here, im trying to write an algorithem to (very) quickly do this: i have a file (around 10gb in size) with letters A->Z randomy (like ASDFSDA) if the input is "ABD" i find the first "A" then find the distance between A to the first "B" (say 5chars), i then need to check if "D" is the same distance from B as A to B. (like B+5chars). what is the best way to go along with this, the file is STATIC and constant, and will not change. any ideas/theories about going along doing this would be greatly appericated! |
Bob Gonder
![]() Delphi Developer |
2007-04-30 07:52:43 AM
Re:Need some suggestions from the experts here, for a fast algorithem :)
desp writes:
Quotei have a file (around 10gb in size) with letters A->Z randomy (like ASDFSDA) BOffset = scan( array, AOffset+1, BVal ) return CVal == array[ BOffset * 2 - AOffset ] Tricky parts being array[] is a file, and offsets may be more than the 4GB limit. I would be tempted to have xOffset be a 2 part value, Sector and Offset. Maybe decide that Sector would be 1MB in size, so disk reads would be 1MB each. Offset would of course be the offset within the 1MB Sector. (I seems to remember someone mentioning that 32KB is optimal read size, rather than 1MB, but then you'd be limiting yourself to 128TB. ) |
Robert Marquardt
![]() Delphi Developer |
2007-04-30 11:47:20 AM
Re:Need some suggestions from the experts here, for a fast algorithem :)
desp writes:
Quotei have a file (around 10gb in size) |
Jonathan Benedicto
![]() Delphi Developer |
2007-04-30 10:10:29 PM
Re:Need some suggestions from the experts here, for a fast algorithem :)
Bob Gonder writes:
Quote(I seems to remember someone mentioning that 32KB is optimal Jon |
JBR
![]() Delphi Developer |
2007-04-30 11:51:08 PM
Re:Need some suggestions from the experts here, for a fast algorithem :)
desp a couch?sur son écran :
QuoteHello, was wondering if some of you could share your knowledge here, |
desp
![]() Delphi Developer |
2007-05-01 02:13:25 AM
Re:Need some suggestions from the experts here, for a fast algorithem :)
----- Original Message -----
From: "John Herbster" <herb-sci1_AT_sbcglobal.net> Newsgroups: borland.public.delphi.language.basm Sent: Monday, April 30, 2007 12:10 AM Subject: Re: Need some suggestions from the experts here, for a fast algorithem :) Quote
"Is it anyhow related to DNA analysis ? :-?" nope. |