-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.10.0 Feedback #448
Comments
No, worries!
Nice! Ya, I was very happy to have found a way to remove that
Agreed. I have a TODO about removing those :)
Not that I can think of. Internally redb treats everything as opaque slices and calls into the compare method to order them. You certainly could get nonsensical results -- like inserting a value, reading back, and getting Ya, so the type stuff for
|
#453 removes the |
I wrote up my plan for changing the argument types to make it consistent whether |
Sorry about not looking at the tuple type stuff sooner! Just upgraded ord to 0.10.0 and wanted to give feedback on the upgrade.
Ord indexing time went down by 10%/1.5 hours, almost certainly because it no longer zeroes pages. So nice improvement there.
Not having to pass the max index size was actually a really nice improvement. We were previously exposing it as a flag, so not having to pass the max index size meant that we could remove that flag, a bunch of related argument parsing code, and plumbing it through to index creation. So now we don't have to do that, which let us delete a bunch of code and confusing command-line options.
Functions like
table.get
andtable.insert
now no longer take a fixed type, so you can't do things liketable.get(&key.into())
, which is slightly annoying, but overall not a huge deal.the
str
alias is probably not super helpful. While adding&
to key and value types, I was actually surprised I didn't have to do the same forstr
, so removing thestr
alias just for the sake of consistency is probably a good idea.Random thought: If
RedbKey
orRedbValue
are implemented incorrectly, could this trigger UB in safe code? For example, if the types don't correspond correctly, or conversion to/from bytes is incorrect. If so, then they should be markedunsafe
.Can
get
without a&
be made to work?get
andinsert
could take anything which implementsBorrow
, andT
implementsBorrow<T>
(blanket impl in stdlib) so then you could do.get([0; 12])
and.get(&[0; 12])
.I'm not entirely clear why some types now need
&
and some don't when used as keys and values. I think ideally, you wouldn't have to add the&
, mostly because some types require it and some types don't. So understanding why[u8; 32]
must be&[u8; 32]
but[u8]
can just be[u8]
and not&[u8]
is a bit of cognitive overhead.The text was updated successfully, but these errors were encountered: