From: Jamey Cribbs Date: 2005-05-18T10:29:44+09:00 Subject: Re: [ANN] KirbyBase 2.2 Oliver Cromm wrote: >So for a start, I plugged KirbyBase in just as a cache - where before, I >was reading header data from a news server each time, in the new version >I save the raw data to a KirbyBase, add only recent messages, then read >the part of the data I want (by date) from the KirbyBase. > > > This might be the source of the slowness. Is this field that you are reading by date defined as a Date field in the KirbyBase table? If it is, this is probably the problem. As I note in the manual, Ruby's Date/DateTime librarys are S-L-O-W! They really need to be rewritten as C libraries. Every time KirbyBase does a select on a Date field, it has to read in each record from the table's physical file and do a Date.new on the data. Like I said, this is slow! Here is an alternative to try: define this field in the table as a String field instead of a Date field. Select's will still work pretty much the same way because, for example: 2005-05-25 > 2005-05-24 and Date.new(2005,05,25) > Date.new(2005,05,24) are both true. In other words, Strings formatted similarly to the way Date's look compare the same way. Give this a try and see if you see a speed improvement. I have tried it and have seen dramatic improvements. Let me know how it goes. Jamey