[Feedreader-development] About crashes with big databases
Brought to you by:
toomastoots
|
From: Toomas T. <to...@i-...> - 2004-05-01 14:28:17
|
Hello!
I think I know what is the problem of Feedreader when subscribing to a
lot of feeds (i have tested with 1000). Problem is not about XML files
but that headline search function and headline database structures are
not optimized for a lot of articles.
Let's say that we have 1000 feeds and every feed has 100 articles (i
think it can be even more, i have some archives set to 500). So now we
have 100000 articles from where to search. Search must be done every
time new headline has to be added to headline database and every time a
feed is selected from left pane. Also this search is runned then
clicking on listview...
But what does our search function look like? Like this :
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Function GetHeadlineIndex( Owner: real; Const headline, link: string;
read: Integer): Integer;
var
i: integer;
begin
// EnterCriticalSection(gCritSect);
try
for i := 0 to length(gHeadlines) - 1 do
begin
if (not gHeadlines[i].deleted) and
((owner = gHeadlines[i].owner) or (owner = 0)) and
((read = gHeadlines[i].IsRead) or (read = -1)) and
((headline = '') or (pos(headline, gHeadlines[i].tiitel) > 0)) and
((link = '') or (pos(link, gHeadlines[i].link) > 0))
then begin
Result := i;
Exit;
end;
end;
finally
// LeaveCriticalSection(gCritSect);
end;
Result := -1;
end;
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
This is dumbest algorithm to use for this kind on job (it was designed
by me :)))) if there are a lot off items in array. It just goes through
entire headline list searching for items.
So, nothing will became better with 500+ subscription databases, if we
have this kind of function. I have even thought about adding database
engine to FR (http://sourceforge.net/projects/tpflashfiler/). BTW this
flashfiler went opensource in jan. 2004. Before it was product of
TurboPower. This makes me think that it can have some quality.
Greetings
Toomas
|