{{ message }}
Repository navigation
Tags: bufbuild/protocompile
Tags
Provide ability for caller to seed/re-use symbol table across compile… … jobs (#294) In addition to allowing a later compilation job to detect collisions with symbols defined in earlier jobs, this also gives the caller access to an index of all symbols, which can be used to implement an efficient resolver over all results of compilation.
Use a profiler to improve linker performance (#291) After measuring the impact of #286, #287, and #290 and seeing it to be too modest. I decided to use a memory profiler, and it found "the good stuff". These changes had the largest impact on allocations and performance. When linking inputs that come from descriptor protos (as opposed to inputs that are compiled from sources and have ASTs), this resulted in a 23% reduction in latency and 70% reduction in allocations. This change features the following improvements: 1. `ast.NoSourceNode` now has a pointer receiver, so wrapping one in an `ast.Node` interface value doesn't incur an allocation to put the value on the heap. This also updates `parser.ParseResult` to refer to a single `*ast.NoSourceNode` when it has no AST, instead of allocating one in each call to get a node value. The `NoSourceNode`'s underlying type is now `ast.FileInfo` so that it can be allocation-free, even for the `NodeInfo` method (which previously was allocating a new `FileInfo` each time). 3. Don't allocate a slice to hold the set of checked files for each element being resolved. Instead, we allocate a single slice up front, and re-use that throughout. 4. Don't pro-actively allocate strings that only are used for error messages; instead defer construction of the change to the construction of the error.
Add editions helper functions for resolving features to protoutil (#283) These helpers, in particular `protoutil.ResolveFeature` and `protoutil.ResolveCustomFeature`, will be used from updated checks for `buf breaking`, which will allow the tool to understand the features-related semantics of the schema. This way, it can correctly report issues with incompatible changes to features in editions source files. And it can also allow changing a file's syntax (like migrating from proto2 or proto3 to editions) as long as there are no actual semantic changes to the schema.
Found and fixed a bug in FieldDescriptor.Cardinality implementation (#… …270) Updates the descriptor implementation tests to check a few other attributes, which uncovered a bug in the `Cardinality` method, which should report "required" for editions fields where `features.field_presence == LEGACY_REQUIRED`.
Add function for stripping source retention options from a descriptor (… …#250) This adds a helper function to the `options` sub-package that can strip "source retention" options from a descriptor. These are options that should only be retained in the descriptor in source form -- like when manipulated by a compiler or code generator -- and should not be present at runtime. Stripping these options results in a descriptor that could safely be embedded in generated code.
Also retrieve file's package when fast-scanning for imports (#209) This augments the experimental fast-scanner `imports.ScanForImports` to also return the package for each scanned file. It's also been renamed to `fastscan.Scan` since it does more than just imports now.
PreviousNext
