albfernandez / javadbf

Java library for reading and writing Xbase (dBase/DBF) files.
GNU Lesser General Public License v3.0
224 stars 98 forks source link

DBFReader#skipRecords:Is it possible to optimize the performance of this method #100

Closed DestinyL closed 11 months ago

DestinyL commented 2 years ago
albfernandez commented 2 years ago

Hi If there are deleted rows the only way is to read all of them (because you need to read it to check the deleted field to discard the deleted row). Can be optimized if all deleted records has been read (track the total records, the file size and the deleted records already discarded, but I think it's too complicate for the small benefit)

DestinyL commented 2 years ago

Hi If there are deleted rows the only way is to read all of them (because you need to read it to check the deleted field to discard the deleted row). Can be optimized if all deleted records has been read (track the total records, the file size and the deleted records already discarded, but I think it's too complicate for the small benefit)

thanks a lot.And then,If there is no delete behavior, is it possible to directly call "skip(int bytesToSkip)".So far by testing, everything seems to be fine, is it possible to do so.

gxywy commented 1 year ago

Hi If there are deleted rows the only way is to read all of them (because you need to read it to check the deleted field to discard the deleted row). Can be optimized if all deleted records has been read (track the total records, the file size and the deleted records already discarded, but I think it's too complicate for the small benefit)

thanks a lot.And then,If there is no delete behavior, is it possible to directly call "skip(int bytesToSkip)".So far by testing, everything seems to be fine, is it possible to do so.

same issue, call nextRecord() is slow, i also think call skip(int bytesToSkip) is more efficient