* Improved encoding and decoding speed of Vec<u8>
* Added black_box calls to benches/string.rs
Added a SizeWriter because someone finally has a benchmark to show it's faster
* Improved performance for `impl<T> Encode for [T]`
* Added #[inline] to `impl Encoder for EncoderImpl`
---------
Co-authored-by: Victor Koenders <victor.koenders@qrtech.se>
* Switched to weak dependencies
* Removed old `serde_impl` references
* Fixed CI and updated documentation
* Fixed a cfg for a test
* Removed unneeded package in Cargo.toml
* tests: fix alloc range test on 32-bit Windows
This test checks the range, which is necessarily different when running
on another platform.
Signed-off-by: Sean Cross <sean@xobs.io>
* enc: case usize/isize as u64/i64 in serialization
The deserialization process assumes that usize/isize are 64-bits, as
does the spec at
https://github.com/bincode-org/bincode/blob/trunk/docs/spec.md#varintencoding
Force `usize` and `isize` to be encoded as `u64` and `i64` to force
32-bit platforms to conform to this spec.
This fixes running tests under `cargo test --target i686-pc-windows-msvc`
Signed-off-by: Sean Cross <sean@xobs.io>
* atomic: only provide Atomic*64 on supported platforms
Not all platforms support AtomicI64 or AtomicU64. Use the
`target_has_atomic` config flag to determine whether to include these.
This fixes#532.
Signed-off-by: Sean Cross <sean@xobs.io>
* atomic: remove feature and use new attributes
Now that there is an attribute to indicate which atomic features are
supported on this platform, remove the `atomic` Feature and use these
new attributes.
Signed-off-by: Sean Cross <sean@xobs.io>
* alloc: run `cargo fmt`
Signed-off-by: Sean Cross <sean@xobs.io>
* Added a basic compatibility test to compare bincode 1 and bincode 2 output
* Moved compatibility to the /compatibility/ crate, made bincode-derive support `#[bincode(crate = "bincode_2")]`
* Added decode/deserialize test to test_same
* Added random test cases to compatibility/src/sway.rs
* Added test for bincode_1::options().with_fixint_encoding() and bincode_2::config::legacy(). Added rand license
* Added comments on why the configs are chosen
* Added Limit<N> and NoLimit to the configuration
* Added a limit check to Decoder and DecoderImpl
* Added test cases, added a helper function specialized for containers
* Added a test to see if inlining makes the limit config faster, added inlining to the decoder
* Add benchmarks for varint parsing
* Enable more inlining
* Outline error construction
* Add provided functions to BincodeRead to customize reading of literals
* Add #[inline] to deserialize_byte
* Outline SliceReader::unexpected_eof so that deserialize_varint inlines
* Implement BincodeRead for std::io::BufReader
* Reimplement all of BincodeRead in terms of BufRead-like functions
* Move branch into error-creation function to get below inline threshold