about summary refs log tree commit diff
path: root/compiler/rustc_serialize
AgeCommit message (Collapse)AuthorLines
2022-01-22Rename `Decoder::read_nil` and `read_unit`.Nicholas Nethercote-5/+5
Because `()` is called "unit" and it makes it match `Encoder::emit_unit`.
2022-01-15Auto merge of #92604 - nnethercote:optimize-impl_read_unsigned_leb128, ↵bors-21/+22
r=michaelwoerister Optimize `impl_read_unsigned_leb128` I see instruction count improvements of up to 3.5% locally with these changes, mostly on the smaller benchmarks. r? `@michaelwoerister`
2022-01-07Unpeel the first iteration of the loop in impl_read_unsigned_leb128.Nicholas Nethercote-2/+11
2022-01-07Modify the buffer position directly when reading leb128 values.Nicholas Nethercote-19/+11
It's a small but clear performance win.
2021-12-28Do not use LEB128 for encoding u16 and i16Jakub Beránek-8/+15
2021-12-13Auto merge of #91626 - klensy:json-less-alloc, r=petrochenkovbors-3/+3
rustc_serialize: don't allocate `String`s as key for `BTreeMap`, when `str` is enough
2021-12-07don't allocate strings when str is enought for using as keyklensy-3/+3
2021-12-06avoid string validation in rustc_serialize, check a marker byte insteadThe 8472-4/+17
since the serialization format isn't self-describing we need a way to detect when encoder and decoder don't match up. but that doesn't have to be utf8 validation for strings, which does cost a few % of performance. Instead we can use a marker byte at the end to be reasonably sure that we're dealing with a string and it wasn't overwritten in some way.
2021-11-22Avoid generating empty closures for fieldless enumsMark Rousskov-0/+28
For many enums, this avoids generating lots of tiny stubs that need to be codegen'd and then inlined and removed by LLVM.
2021-10-15Revert "Auto merge of #89709 - clemenswasser:apply_clippy_suggestions_2, ↵Matthias Krüger-2/+2
r=petrochenkov" The PR had some unforseen perf regressions that are not as easy to find. Revert the PR for now. This reverts commit 6ae8912a3e7d2c4c775024f58a7ba4b1aedc4073, reversing changes made to 86d6d2b7389fe1b339402c1798edae8b695fc9ef.
2021-10-10Apply clippy suggestionsClemens Wasser-2/+2
2021-09-20Migrate to 2021Mark Rousskov-1/+1
2021-09-10rustc: Remove local variable IDs from `Export`sVadim Petrochenkov-0/+12
Local variables can never be exported.
2021-08-22Fix more “a”/“an” typosFrank Steffahn-2/+2
2021-08-22Fix typos “a”→“an”Frank Steffahn-1/+1
2021-08-18Remove box syntax from rustc_serializeest31-2/+1
2021-07-29rfc3052: Remove authors field from Cargo manifestsJade-1/+0
Since RFC 3052 soft deprecated the authors field anyway, hiding it from crates.io, docs.rs, and making Cargo not add it by default, and it is not generally up to date/useful information, we should remove it from crates in this repo.
2021-06-17Emit warnings for unused fields in custom targets.Adam Bratschi-Kaye-0/+9
2021-06-14Use the now available implementation of `IntoIterator` for arraysLeSeulArtichaut-1/+1
2021-06-07Auto merge of #85903 - bjorn3:rustc_serialize_cleanup, r=varkorbors-279/+73
Remove unused functions and arguments from rustc_serialize
2021-06-01Remove unused functions and arguments from rustc_serializebjorn3-279/+73
2021-05-31Remove unused feature gatesbjorn3-3/+0
2021-03-26Auto merge of #83465 - michaelwoerister:safe-read_raw_bytes, r=cjgillotbors-35/+18
Allow for reading raw bytes from rustc_serialize::Decoder without unsafe code The current `read_raw_bytes` method requires using `MaybeUninit` and `unsafe`. I don't think this is necessary. Let's see if a safe interface has any performance drawbacks. This is a followup to #83273 and will make it easier to rebase #82183. r? `@cjgillot`
2021-03-25Allow for reading raw bytes from rustc_serialize::Decoder without unsafe code.Michael Woerister-35/+18
2021-03-24Revert "Revert stabilizing integer::BITS."Mara Bos-2/+0
2021-03-19Move raw bytes handling to Encoder/Decoder.Camille GILLOT-44/+70
2021-03-18Simplify IntEncodedWithFixedSize.Camille GILLOT-13/+7
2021-03-18Move IntEncodedWithFixedSize to rustc_serialize.Camille GILLOT-0/+48
2021-02-20Update the bootstrap compilerJoshua Nelson-1/+0
Note this does not change `core::derive` since it was merged after the beta bump.
2021-02-14bumped smallvec depsklensy-1/+1
2021-02-03Revert stabilizing integer::BITS.Mara Bos-0/+2
2021-01-31stabilize int_bits_constAshley Mannix-2/+0
2021-01-11rustc_serialize: fix incorrect signed LEB128 decodingTyson Nottingham-58/+89
The signed LEB128 decoding function used a hardcoded constant of 64 instead of the number of bits in the type of integer being decoded, which resulted in incorrect results for some inputs. Fix this, make the decoding more consistent with the unsigned version, and increase the LEB128 encoding and decoding test coverage.
2021-01-11Serialize incr comp structures to file via fixed-size bufferTyson Nottingham-69/+496
Reduce a large memory spike that happens during serialization by writing the incr comp structures to file by way of a fixed-size buffer, rather than an unbounded vector. Effort was made to keep the instruction count close to that of the previous implementation. However, buffered writing to a file inherently has more overhead than writing to a vector, because each write may result in a handleable error. To reduce this overhead, arrangements are made so that each LEB128-encoded integer can be written to the buffer with only one capacity and error check. Higher-level optimizations in which entire composite structures can be written with one capacity and error check are possible, but would require much more work. The performance is mostly on par with the previous implementation, with small to moderate instruction count regressions. The memory reduction is significant, however, so it seems like a worth-while trade-off.
2021-01-01rustc_serialize: specialize opaque decoding of some u8 sequencesTyson Nottingham-26/+33
2021-01-01rustc_serialize: have read_raw_bytes take MaybeUninit<u8> sliceTyson Nottingham-3/+13
2021-01-01rustc_serialize: specialize opaque encoding of some u8 sequencesTyson Nottingham-19/+20
2020-12-26stabilize min_const_genericsBastian Kauschke-1/+1
2020-12-03Fix some clippy lintsJoshua Nelson-1/+1
2020-10-13Replace absolute paths with relative onesest31-3/+3
Modern compilers allow reaching external crates like std or core via relative paths in modules outside of lib.rs and main.rs.
2020-09-26Deduplicate and generalize some (de/)serializer implsOliver Scherer-23/+12
2020-09-23/nightly/nightly-rustcErik Hofmayer-1/+1
2020-09-23Updated html_root_url for compiler cratesErik Hofmayer-1/+1
2020-08-30mv compiler to compiler/mark-0/+6101