Comments (7)
Maybe From::from
rather than Bitmap::of
? (so Bitmap::from(&[0, 1, 2])
rather than of
) (and add From<[u32; N]>
)
from croaring-rs.
Should we also try to future proof ourselves to have a
ViewDeserializer
vsUncheckedViewDeserializer
(I'm expecting a safe view function at some point)
I've looked into providing a safe view deserialization function in CRoaring. My intention was to add two checks:
- Guard against buffer overflows. This is fairly easy, though a bit cumbersome.
- Validate alignment. My assumption was that if the input buffer was aligned, then all accesses would be aligned. Unfortunately this turned out not to be true. Because the
runFlagBitset
in the header has a variable number of bytes, this can cause unaligned accesses, even if the input buffer is aligned.
Unfortunately I don't see a good way of solving (2) without changing the spec, e.g. padding runFlagBitset
to ensure alignment. As such, I don't think we should hold our breath on a safe view function (though I'd love to see it!) 😢
Generally speaking, I'd love to see a 1.0 release. My motivation is to use croaring
via plrust
in AWS RDS Postgres. I believe the next RDS plrust
release is 1-3 months away, and I'd love to see croaring
v1.0 supported rather than v0.9. That being said, I acknowledge that breaking changes should not be rushed. If I can help, let me know 😊
from croaring-rs.
Thinking we might want to add the ability to serialize treemaps into any writer so we don't necessarily need to keep it all in memory. We'll probably want both into any writer, and into a Vec, since for Frozen we need to ensure alignment, and we can't guarantee the writer will start aligned.
from croaring-rs.
I don't see a deserialize from reader in this implementation. roaring-rs has one (although it's very slow).
from croaring-rs.
Correct, there is not one in CRoaring. But we can write each bitmap in a treemap without keeping the full serialized treemap in memory, and the caller could use mmap to read the treemap without requiring as much heap memory use. Not super useful, but might as well since we can support it, and if CRoaring ever does get streaming ser/deserialization, we can use that for more wins.
from croaring-rs.
Is there a view from bytes for treemaps?
from croaring-rs.
No, sorry, I'm still not being clear, just to avoid two copies on the heap, you could deserialize from a file backed mmap, but there's not currently a way of creating a view for treemaps over an existing byte slice.
from croaring-rs.
Related Issues (20)
- Does it support java Roaring64NavigableMap? HOT 3
- Support for native serialization format HOT 1
- croaring-rs in RoaringBitmap organisation HOT 2
- Build failed HOT 5
- macOS Sonoma builds fail HOT 2
- Unable to build on macOS HOT 1
- Treemap::andnot_inplace clears the treemap when comparing to empty treemap HOT 2
- Expose roaring_read_uint32_iterator safely HOT 2
- Serialization always starts with same bytes HOT 1
- Consider supporting a later version of the bindgen HOT 1
- Deserialize on invalid bytes produces invalid Bitmap HOT 1
- Make -march=native entirely optional to the build in croaring-sys HOT 1
- Iterating over all values in bitmap seems slow HOT 5
- failed to build on macOS 11.0.1 (Big Sur) HOT 2
- Failed to build on Apple Silicon HOT 1
- How to manually open AVX2 support in CRoaring? HOT 1
- build failing on musl libc HOT 1
- Bundle pre-bindgen'd bindings for -sys package HOT 2
- Support for frozen methods
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from croaring-rs.