mbdavid / LiteDB

LiteDB - A .NET NoSQL Document Store in a single data file
http://www.litedb.org
MIT License
8.52k stars 1.24k forks source link

Fix LiteFileStream.SetReadStreamPosition #2459

Closed SpaceCheetah closed 3 months ago

SpaceCheetah commented 6 months ago

Fix for issue #2458. Not a great solution, since it makes seeking much more expensive, but it works in my situation. I don't think there's a way to make it significantly faster without making chunks uniform length, which would require changes on the write side and not work for existing databases.

bnuzhouwei commented 5 months ago

What version can use this fix?

SpaceCheetah commented 5 months ago

What version can use this fix?

Looking at the git blame, should be valid for basically any version from the last five years or so, though you'd have to apply the commit from my branch to that version. There's no released version with it, so no matter what you'd have to build it yourself. That said, file streams need some pretty big fixes, this is just a patch to fix it for my use cases.

JKamsker commented 3 months ago

I would like to see some unitttests for this pr as i currently don't fully understand the issue.

JKamsker commented 3 months ago

Thank you for your contribution and bearing with me :D