ipfs / go-ds-flatfs

A datastore implementation using sharded directories and flat files to store data
MIT License
46 stars 21 forks source link

fix: actually use the size hint in util_windows.go #109

Closed Jorropo closed 1 year ago

Jorropo commented 2 years ago

This code was broken, it computed the size hint to do nothing with it.

Found with this profile: Capture d’écran du 2022-08-02 15-40-33

This profile clearly show a pattern of append's growth. With this new code the only way to append is if the size hint undershoot (which would require more data to be written between the Size and Read calls). Might be worth a panic("race") or returning an error if that happen ?

welcome[bot] commented 2 years ago

Thank you for submitting this PR! A maintainer will be here shortly to review it. We are super grateful, but we are also overloaded! Help us by making sure that:

Getting other community members to do a review would be great help too on complex PRs (you can ask in the chats/forums). If you are unsure about something, just leave us a comment. Next steps:

We currently aim to provide initial feedback/triaging within two business days. Please keep an eye on any labelling actions, as these will indicate priorities and status of your contribution. We are very grateful for your contribution!

Jorropo commented 2 years ago

Found with @Arlodotexe

Jorropo commented 1 year ago

I overlooked it didn't built ... :'( thx I'll release after I get an O_TMPFILE patch ready for linux.