Joshua Haberman
0497f8deed
Fixed a critical bug on 32-bit builds, and added much more Kokoro testing.
...
There was a bug in our arena code where we assumed that
sizeof(upb_array) would be a multiple of 8. On i386 it was
not, and this was causing memory corruption on 32-bit builds.
4 years ago
Joshua Haberman
64abb5eb11
Amalgamation no longer bundles wyhash, but #includes it.
...
Also fixed a few spelling mistakes.
4 years ago
Joshua Haberman
c9f9668234
symtab: use longjmp() for errors and avoid intermediate table.
...
We used to use a separate "add table" during the upb_symtab_addfile()
operation to make it easier to back out the file if it contained
errors. But this created unnecessary work of re-adding the same symbols
to the main symtab once everything was validated.
Instead we directly add symbols to the main symbols table. If there is
an error in validation, we remove precisely the set of symbols that
were already added.
This also requires using a separate arena for each file. We can fuse
it with the symtab's main arena if the operation is successful.
LoadDescriptor_Upb 61.2µs ± 4% 53.5µs ± 1% -12.50% (p=0.000 n=12+12)
LoadAdsDescriptor_Upb 4.43ms ± 1% 3.06ms ± 0% -31.00% (p=0.000 n=12+12)
LoadDescriptor_Proto2 257µs ± 0% 259µs ± 0% +1.00% (p=0.000 n=12+12)
LoadAdsDescriptor_Proto2 13.9ms ± 1% 13.9ms ± 1% ~ (p=0.128 n=12+12)
4 years ago
Joshua Haberman
f2d826b9f3
Got rid of floating-point division in table init.
...
Ideally we would get rid of all floating-point operations
in table.c, but that's a job for another day.
4 years ago
Joshua Haberman
154f2c25f4
Added UTF-8 validation for proto3 string fields.
4 years ago
Joshua Haberman
e86541ac1d
Fixed the build after the merge.
4 years ago
Joshua Haberman
a0d16e7073
Added a few missing copts, and made some functions proper prototypes.
4 years ago
Joshua Haberman
8f3ee80d46
Drop C89/C90 support and MSVC prior to Visual Studio 2015.
...
upb previously attempted to support C89 and pre-2015 versions
of Visual Studio. This was to support older compilers with
limited C99 support (particularly MSVC). But as of last August,
even gRPC has dropped support for MSVC prior to 2015
c87276d058
Therefore it seems safe for upb to no longer attempt C89 support
(we were already not truly C89 compliant, with our use of "bool").
We now explicitly require C99 or greater and MSVC 2015 or greater.
This cleaned up port_def.inc a fair bit. I took the chance to
also remove some obsolete macros.
4 years ago
Joshua Haberman
86d9908c55
Fastdecode support for packed fields.
...
This is not very optimized yet. There is a lot of room to
optimize it further.
4 years ago
Joshua Haberman
e3e797b680
Added fasttable support for oneofs.
4 years ago
Joshua Haberman
e2c709e047
Repeated string and primitive support.
...
Much of the code was adapted from Gerben's code in:
6333031195
4 years ago
Joshua Haberman
25db40bc30
Fixed upb::InlinedArena, which was compeltely broken.
4 years ago
Joshua Haberman
2c1664906a
Removed license comments and upb_amalgamation for google3.
4 years ago
Joshua Haberman
b7dc77415a
Added licenses() to all BUILD files.
4 years ago
Joshua Haberman
e3f41de6c7
Split monolithic BUILD file into many build files.
4 years ago
Joshua Haberman
d0e4b688c6
Shorten name of kAliasString, so benchmark results don't wrap.
4 years ago
Joshua Haberman
bf393bf086
Cleaned up benchmark names.
4 years ago
Joshua Haberman
9eb8414b31
Added descriptor_sv.proto.
4 years ago
Joshua Haberman
de1b6b0718
Refactored proto2 benchmarks and added StringView benchmark.
4 years ago
Joshua Haberman
52721eadc7
Order LargeInitialBlock after non-initial-block test.
4 years ago
Joshua Haberman
44a7130845
Used the correct copy of the protos in the benchmark.
4 years ago
Joshua Haberman
de80054018
Make required fields optional for benchmarking.
4 years ago
Joshua Haberman
fd5a35d49d
Minor comment changes.
4 years ago
Joshua Haberman
27262adf93
Snapshot descriptor.proto into our own copy for benchmarking purposes.
...
This will ensure that the schema and payload are constant across
time and space.
4 years ago
Joshua Haberman
4f901b6430
Passes all tests.
4 years ago
Joshua Haberman
42d2f6cef9
Add MB/s measures in the benchmarks.
...
Current output on my machine is:
-----------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
-----------------------------------------------------------------------------------------
BM_ArenaOneAlloc 21 ns 21 ns 33344552
BM_ArenaInitialBlockOneAlloc 6 ns 6 ns 115948084
BM_LoadDescriptor_Upb 107286 ns 107275 ns 6512 67.5731MB/s
BM_LoadDescriptor_Proto2 240539 ns 240537 ns 2909 30.1362MB/s
BM_ParseDescriptor_Upb_LargeInitialBlock 11500 ns 11499 ns 60864 630.377MB/s
BM_ParseDescriptor_Upb 11920 ns 11920 ns 58676 608.123MB/s
BM_ParseDescriptor_Proto2_NoArena 31338 ns 31336 ns 22389 231.325MB/s
BM_ParseDescriptor_Proto2_Arena 21622 ns 21622 ns 32472 335.26MB/s
BM_ParseDescriptor_Proto2_Arena_LargeInitialBlock 17799 ns 17798 ns 39266 407.288MB/s
BM_SerializeDescriptor_Proto2 4943 ns 4942 ns 141050 1.43252GB/s
BM_SerializeDescriptor_Upb 12262 ns 12261 ns 57131 591.195MB/s
4 years ago
Joshua Haberman
1ce98b86ec
Added LoadDescriptor benchmark for proto2.
4 years ago
Joshua Haberman
4890735ce2
Added benchmark for descriptor loading.
4 years ago
Joshua Haberman
6f59f1256e
Optimizations to descriptor loading.
4 years ago
Joshua Haberman
d5096f9ee8
Fixed bug in addunknown and added ASAN poisoning.
4 years ago
Joshua Haberman
5aa5b77b41
Added simple offset-based accessors for defs, and deprecated old iterators.
4 years ago
Joshua Haberman
bc301e7da4
Use merge/partial variants to give proto2 benchmark the fairest hearing.
4 years ago
Joshua Haberman
30f01afa83
Added LargeInitialBlock test for proto2.
4 years ago
Joshua Haberman
5d23fd99af
Used shorter protobuf:: namespace alias.
4 years ago
Joshua Haberman
537b6f42c2
A few updates to the benchamrk and minor implementation changes.
4 years ago
Joshua Haberman
9e5c5ce089
Optimized memset() with cutoff and fixed group & unknown message bugs.
4 years ago
Joshua Haberman
8dd7b5a2ca
A bunch more optimization.
4 years ago
Joshua Haberman
e46e94ec7f
Added benchmarks for proto2.
4 years ago
Joshua Haberman
d43ccfa079
Revert test changes.
4 years ago
Joshua Haberman
fac992db83
Cleanup for showing.
4 years ago
Joshua Haberman
80441e4eb4
Optimized binary encoder.
4 years ago
Joshua Haberman
6e140c267c
Added benchmark for encoding.
4 years ago
Joshua Haberman
8e26a33bcb
Added a test for UTF-8 parse checking and added missing error reporting.
4 years ago
Joshua Haberman
8f11ec57d2
Applied changes from google3.
5 years ago
Joshua Haberman
922c126b8b
Fixed unit test errors that were causing Valgrind failures.
5 years ago
Joshua Haberman
086a68d191
Fixed memory leak that could occur after upb_arena_fuse().
...
Also added valgrind testing for Kokoro.
5 years ago
Joshua Haberman
35abcc248b
Added test that should trigger a memory leak.
5 years ago
Joshua Haberman
0dc2394da5
Changes to support import into google3 ( #291 )
...
* Fixes for google3.
* Added to failure list for new failure.
* Reused existing failure list file.
* Add a ./ to assist rewriting.
5 years ago
Joshua Haberman
b717575cef
Added -Wextra and -Wshorten-64-to-32 and fixed resulting errors. ( #289 )
...
* Added -Wextra and -Wshorten-64-to-32 and fixed resulting errors.
* Disable -Wshorten-32-to-64 since Kokoro is missing Clang.
* Fixed -Wextra warnings for gcc.
* Reordered UPB_UNUSED() to come after declarations.
* Added another -pedantic fix and log CC version.
* Fix compile error and conditionally run use_bazel.sh.
* Moved set -e after use_bazel.sh.
* Fixed typo in conditional.
5 years ago
Joshua Haberman
a1c2caeb25
More arena tests. ( #279 )
5 years ago