* Added support for proto3 optional to defs.
* Added proto3 optional support. Untested at the moment.
* Changes to support proto3 optional.
* Fixed real oneof count for messages with no fields.
* Fixed compile error and test.
* Added comment about why I'm commenting out the assert.
This makes both the C (.h) and C++ (.hpp) files read nicer
and keeps the core of upb C-only.
Existing users of the C++ wrappers will have to add manual
#includes of the .hpp files.
* WIP.
* Passes most tests.
* A few fixes.
* A few optimizations.
* Some more optimiation.
* Update Protobuf to v3.11.4 and Abseil to LTS 2020-02-25
* Use longjmp instead of explicit error checks at every level.
* Used macros for better documentation of ops.
* Fixed bug with map parsing. All tests are passing except a few conformance tests.
* Fixed remaining bugs, all conformance tests pass.
Also ported all of upb to a single UPB_PTR_AT() macro instead of
having multiple .c files define their own.
* Formatted with clang-format.
* Fixes to compile on Linux.
* A few more compile fixes.
* Script to benchmark changes.
* Fixed parenthesis bug in op calculation.
* Updated generated descriptor files.
* WIP.
* Removed trailing enum to fix the Linux build.
* Respect packed=false to fix conformance failures in new protobuf version.
* Small simplification.
* Fixes to decoder.
* Removed stray comment.
Co-authored-by: Yannic Bonenberger <contact@yannic-bonenberger.com>
New code is smaller (in both source size and compiled size) and faster.
# Speed
The decoder speeds up on all machines I tested, though the amount of speedup varies. I was only able to test Intel CPUs.
### Linux Desktop
```
CPU: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
OS: Linux
name old time/op new time/op delta
CreateArena 4.72ns ± 0% 4.93ns ± 0% +4.47% (p=0.000 n=11+11)
ParseDescriptor 12.4µs ± 1% 9.1µs ± 1% -26.65% (p=0.000 n=11+11)
```
### Mac Laptop
```
CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
OS: macOS
name old time/op new time/op delta
CreateArena 5.33ns ± 3% 5.58ns ± 2% +4.69% (p=0.000 n=12+12)
ParseDescriptor 15.0µs ± 2% 11.9µs ± 2% -20.20% (p=0.000 n=12+12)
```
### Linux Workstation
```
CPU: Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz
OS: Linux
name old time/op new time/op delta
CreateArena 5.29ns ± 0% 5.52ns ± 0% +4.37% (p=0.000 n=10+12)
ParseDescriptor 18.6µs ± 0% 16.4µs ± 0% -11.54% (p=0.000 n=12+12)
```
# Size
A few source files grow marginally because of some arena functionality moved inline. But `upb/decode.c` shrinks by 30% on Linux:
```
VM SIZE
--------------
+2.1% +283 upb/json_decode.c
+24% +205 upb/msg.c
+8.4% +115 upb/upb.c
+0.9% +28 upb/reflection.c
[ = ] 0 upb/def.c
[ = ] 0 upb/encode.c
[ = ] 0 upb/json_encode.c
[ = ] 0 upb/table.c
-30.3% -1.51Ki upb/decode.c
-0.7% -738 TOTAL
```
* [textformat]: added missing newline when a message opens.
* Added tostring() support to Lua that prints to text format.
Also fixed a gnarly bug that this exposed.
Map parsing/serializing relies on map entries always
having a predictable order. The code that generates
layout was not respecting this in the case of string
keys and primitive values.
* WIP, first version of encoder.
* More progress on text encoder.
* A lot of progress on the text printer.
* Added textencode header file.
* Text encoder now passes conformance tests.
These aren't very stringent though, and more testing is needed.
* Print text into static buffer. Passes all conformance tests.
* Fixed kokoro errors.
* Fix for indent depth when printing map fields.