Eric Salo
e1e8f1e222
upb: create upb/base/BUILD
...
The next in a series of CLs to split upb/BUILD into subdirs.
PiperOrigin-RevId: 552010931
1 year ago
Eric Salo
cafbe958fd
upb: clean up benchmark.cc to make the compiler less unhappy
...
PiperOrigin-RevId: 550980276
1 year ago
Joshua Haberman
3b0c9261c6
Update to ads v13, to unbreak the build.
...
Ads removed v11 earlier today: ee990a675b
PiperOrigin-RevId: 520446026
2 years ago
Joshua Haberman
d520014cfa
Added benchmarks for `upb_Arena_Fuse()`
...
I added two variants, one which is unbalanced (always fusing a single arena into the group) while the other is balanced (always fusing two groups of equal size).
Unfortunately it is difficult to benchmark `upb_Arena_Free()` separately from fuse, since the only way to get a non-zero refcount is to fuse.
Results on my machine:
```
CPU: Intel Skylake Xeon with HyperThreading (48 cores) dL1:32KB dL2:1024KB dL3:38MB
Benchmark Time(ns) CPU(ns) Iterations
-------------------------------------------------------------------
BM_ArenaFuseUnbalanced/2 52.2 52.2 1000000 38.300M items/s
BM_ArenaFuseUnbalanced/8 416 416 142315 19.243M items/s
BM_ArenaFuseUnbalanced/64 4034 4033 14306 15.868M items/s
BM_ArenaFuseUnbalanced/128 8302 8301 6837 15.420M items/s
BM_ArenaFuseBalanced/2 54.7 54.7 1000000 36.581M items/s
BM_ArenaFuseBalanced/8 425 425 100000 18.845M items/s
BM_ArenaFuseBalanced/64 4029 4029 14632 15.886M items/s
BM_ArenaFuseBalanced/128 8050 8049 7176 15.902M items/s
```
PiperOrigin-RevId: 518292073
2 years ago
Mike Kruskal
2b011bc759
Internal changes
...
PiperOrigin-RevId: 487599716
2 years ago
Eric Salo
41335a03be
normalize upb_Message_New()
...
We had _upb_Message_New(), which created a message from a mini table and was
being used outside of upb even though it is an internal-only function.
We also had upb_Message_New(), which created a message from a message def.
Now there is a single public function, upb_Message_New(), which creates a
message from a mini table and covers all use cases. (The internal version has the same definition and is used for inlining.)
PiperOrigin-RevId: 480169804
2 years ago
Protobuf Team Bot
04363f7bae
Update workspace_deps.bzl protobuf main commit
...
PiperOrigin-RevId: 479635174
2 years ago
Eric Salo
edecfd5eb0
upb: use the new reflection headers
...
Reflection headers now live in upb/reflection/ so update our include statements to
reflect this. (See what I did there?)
PiperOrigin-RevId: 474596615
2 years ago
Protobuf Team Bot
97993b219d
rename upb::SymbolTable as upb::DefPool
...
PiperOrigin-RevId: 456147709
2 years ago
Protobuf Team Bot
88047d90ba
update benchmark.cc from v7 to v11 of the google ads proto
...
PiperOrigin-RevId: 455675163
2 years ago
Joshua Haberman
6af01a26a0
Ran clang-format.
3 years ago
Joshua Haberman
4c9891bf3e
Renamed LoadDefInit_NoLayout() to LoadDefInit_BuildLayout().
...
This will clarify that the function should go with the
WithLayout benchmarks.
3 years ago
Joshua Haberman
205a7ea8b1
Added a variant of the def-loading benchmark that builds layout dynamically.
...
This will help us evaluate the performance impacts (if any) that the
new mini-table building code will have.
3 years ago
Joshua Haberman
1c955f37ce
Mass API rename and clang-reformat ( #485 )
...
* Wave 1: upb_fielddef.
* upb_fielddef itself.
* upb_oneofdef.
* upb_msgdef.
* ExtensionRange.
* upb_enumdef
* upb_enumvaldef
* upb_filedef
* upb_methoddef
* upb_servicedef
* upb_symtab
* upb_defpool_init
* upb_wellknown and upb_syntax_t
* Some constants.
* upb_status
* upb_strview
* upb_arena
* upb.h constants
* reflection
* encode
* JSON decode.
* json encode.
* msg_internal.
* Formatted with clang-format.
* Some naming fixups and comment reformatting.
* More refinements.
* A few more stragglers.
* Fixed PyObject_HEAD with semicolon. Removed TODO entries.
3 years ago
Joshua Haberman
41bfbca375
Updated ads benchmark to v7 as v5 no longer exists upstream.
3 years ago
Joshua Haberman
cdd6434a31
Introduced upb_extreg and plumbed it into decoder.
4 years ago
Joshua Haberman
823eb09694
Update all 2011 dates to 2021.
4 years ago
Joshua Haberman
e59d2c8fa7
Added license headers to all files.
4 years ago
Joshua Haberman
65d166a6ba
Added API for copy vs. alias and added benchmarks to test both.
...
Benchmark output:
$ bazel-bin/benchmarks/benchmark '--benchmark_filter=BM_Parse'
2020-11-11 15:39:04
Running bazel-bin/benchmarks/benchmark
Run on (72 X 3700 MHz CPU s)
CPU Caches:
L1 Data 32K (x36)
L1 Instruction 32K (x36)
L2 Unified 1024K (x36)
L3 Unified 25344K (x2)
-------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------------------------------------
BM_Parse_Upb_FileDesc<UseArena, Copy> 4134 ns 4134 ns 168714 1.69152GB/s
BM_Parse_Upb_FileDesc<UseArena, Alias> 3487 ns 3487 ns 199509 2.00526GB/s
BM_Parse_Upb_FileDesc<InitBlock, Copy> 3727 ns 3726 ns 187581 1.87643GB/s
BM_Parse_Upb_FileDesc<InitBlock, Alias> 3110 ns 3110 ns 224970 2.24866GB/s
BM_Parse_Proto2<FileDesc, NoArena, Copy> 31132 ns 31132 ns 22437 229.995MB/s
BM_Parse_Proto2<FileDesc, UseArena, Copy> 21011 ns 21009 ns 33922 340.812MB/s
BM_Parse_Proto2<FileDesc, InitBlock, Copy> 17976 ns 17975 ns 38808 398.337MB/s
BM_Parse_Proto2<FileDescSV, InitBlock, Alias> 17357 ns 17356 ns 40244 412.539MB/s
4 years ago
Joshua Haberman
7b4e376f79
Switch unordered_set -> absl::flat_hash_set.
4 years ago
Joshua Haberman
fe62fc83e1
Removed obsolete includes in benchmark.
4 years ago
Joshua Haberman
5b1f0d86a1
For Kokoro, only build/test -m32 on Linux.
...
Also fixed a bunch of bugs found by gcc's -fanalyzer.
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
5ec1d39224
Avoid building .pb.cc for ads protos, as C++ takes forever to compile.
4 years ago
Joshua Haberman
c3b5637646
Added benchmark for loading ads descriptor.
...
Generally this seems to track the speed of loading descriptor.proto.
----------------------------------------------------------------------------------------------------
Benchmark Time CPU Iterations
----------------------------------------------------------------------------------------------------
BM_LoadDescriptor_Upb 59091 ns 59086 ns 11747 121.182MB/s
BM_LoadAdsDescriptor_Upb 4218587 ns 4218582 ns 166 120.544MB/s
BM_LoadDescriptor_Proto2 241083 ns 241049 ns 2903 29.7043MB/s
BM_LoadAdsDescriptor_Proto2 13442631 ns 13442099 ns 52 34.8975MB/s
4 years ago
Joshua Haberman
723cd8ffc1
Added wyhash code and LICENSE, and removed temporary benchmark.
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
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
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
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
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
80441e4eb4
Optimized binary encoder.
4 years ago
Joshua Haberman
6e140c267c
Added benchmark for encoding.
4 years ago
Joshua Haberman
2b1e7dc1cc
Arena refactor: moves cleanup list into regular blocks ( #277 )
...
* WIP.
* WIP.
* Tests are passing.
* Recover some perf: LIKELY doesn't propagate through functions. :(
* Added some more benchmarks.
* Simplify & optimize upb_arena_realloc().
* Only add owned blocks to the freelist.
* More optimization/simplification.
* Re-fixed the bug.
* Revert unintentional changes to parser.rl.
* Revert Lua changes for now.
* Revert the arena fuse changes for now.
* Added last_size to the arena representation.
* Fixed compile errors.
* Fixed compile error and changed benchmarks to do one allocation.
5 years ago
Joshua Haberman
025cc2ec3d
New arena benchmarks that actually hit the heap. ( #275 )
5 years ago
Joshua Haberman
901463e41e
Added benchmark of parsing.
6 years ago