diff options
-rw-r--r-- | Makefile | 22 | ||||
-rw-r--r-- | benchmark/benchmark.cc (renamed from benchmark.cc) | 0 | ||||
-rw-r--r-- | benchmark/google_message1.dat (renamed from google_message1.dat) | bin | 228 -> 228 bytes | |||
-rw-r--r-- | benchmark/google_message2.dat (renamed from google_message2.dat) | bin | 84570 -> 84570 bytes | |||
-rw-r--r-- | benchmark/google_messages.proto | 134 | ||||
-rw-r--r-- | benchmark/google_messages.proto.bin (renamed from google_messages.proto.bin) | 0 | ||||
-rw-r--r-- | descriptor/descriptor.c (renamed from descriptor.c) | 0 | ||||
-rw-r--r-- | descriptor/descriptor.h (renamed from descriptor.h) | 0 | ||||
-rw-r--r-- | src/upb.h (renamed from upb.h) | 0 | ||||
-rw-r--r-- | src/upb_context.c (renamed from upb_context.c) | 0 | ||||
-rw-r--r-- | src/upb_context.h (renamed from upb_context.h) | 0 | ||||
-rw-r--r-- | src/upb_enum.c (renamed from upb_enum.c) | 0 | ||||
-rw-r--r-- | src/upb_enum.h (renamed from upb_enum.h) | 0 | ||||
-rw-r--r-- | src/upb_inlinedefs.c (renamed from upb_inlinedefs.c) | 0 | ||||
-rw-r--r-- | src/upb_msg.c (renamed from upb_msg.c) | 0 | ||||
-rw-r--r-- | src/upb_msg.h (renamed from upb_msg.h) | 0 | ||||
-rw-r--r-- | src/upb_parse.c (renamed from upb_parse.c) | 0 | ||||
-rw-r--r-- | src/upb_parse.h (renamed from upb_parse.h) | 0 | ||||
-rw-r--r-- | src/upb_string.c (renamed from upb_string.c) | 0 | ||||
-rw-r--r-- | src/upb_string.h (renamed from upb_string.h) | 0 | ||||
-rw-r--r-- | src/upb_table.c (renamed from upb_table.c) | 0 | ||||
-rw-r--r-- | src/upb_table.h (renamed from upb_table.h) | 0 | ||||
-rw-r--r-- | tests/test_table.cc (renamed from test_table.cc) | 0 | ||||
-rw-r--r-- | tests/test_util.h (renamed from test_util.h) | 0 | ||||
-rw-r--r-- | tests/tests.c (renamed from tests.c) | 0 | ||||
-rw-r--r-- | tools/upbc.c (renamed from upbc.c) | 0 |
26 files changed, 146 insertions, 10 deletions
@@ -3,18 +3,20 @@ CC=gcc CXX=g++ CFLAGS=-std=c99 -CPPFLAGS=-O3 -Wall -Wextra -pedantic -g -DUPB_UNALIGNED_READS_OK -fomit-frame-pointer -OBJ=upb_parse.o upb_table.o upb_msg.o upb_enum.o upb_context.o upb_string.o descriptor.o -all: $(OBJ) test_table tests upbc +CPPFLAGS=-O3 -Wall -Wextra -pedantic -g -DUPB_UNALIGNED_READS_OK -fomit-frame-pointer -Idescriptor -Isrc +OBJ=src/upb_parse.o src/upb_table.o src/upb_msg.o src/upb_enum.o src/upb_context.o \ + src/upb_string.o descriptor/descriptor.o +ALL=$(OBJ) src/libupb.a tests/test_table tests/tests tools/upbc +all: $(ALL) clean: - rm -f *.o test_table tests + rm -f $(ALL) deps -libupb.a: $(OBJ) - ar rcs libupb.a $(OBJ) -test_table: libupb.a -upbc: libupb.a -benchmark: libupb.a -lm +src/libupb.a: $(OBJ) + ar rcs src/libupb.a $(OBJ) +tests/test_table: src/libupb.a +tools/upbc: src/libupb.a +benchmark/benchmark: src/libupb.a -lm -include deps -deps: *.c *.h +deps: src/*.c src/*.h descriptor/*.c descriptor/*.h tests/*.c tests/*.h tools/*.c tools/*.h gcc -MM *.c > deps diff --git a/benchmark.cc b/benchmark/benchmark.cc index 05184bc..05184bc 100644 --- a/benchmark.cc +++ b/benchmark/benchmark.cc diff --git a/google_message1.dat b/benchmark/google_message1.dat Binary files differindex bc0f064..bc0f064 100644 --- a/google_message1.dat +++ b/benchmark/google_message1.dat diff --git a/google_message2.dat b/benchmark/google_message2.dat Binary files differindex 06c0944..06c0944 100644 --- a/google_message2.dat +++ b/benchmark/google_message2.dat diff --git a/benchmark/google_messages.proto b/benchmark/google_messages.proto new file mode 100644 index 0000000..97356ec --- /dev/null +++ b/benchmark/google_messages.proto @@ -0,0 +1,134 @@ + +package benchmarks; + +message SpeedMessage1 { + required string field1 = 1; + optional string field9 = 9; + optional string field18 = 18; + optional bool field80 = 80 [default=false]; + optional bool field81 = 81 [default=true]; + required int32 field2 = 2; + required int32 field3 = 3; + optional int32 field280 = 280; + optional int32 field6 = 6 [default=0]; + optional int64 field22 = 22; + optional string field4 = 4; + repeated fixed64 field5 = 5; + optional bool field59 = 59 [default=false]; + optional string field7 = 7; + optional int32 field16 = 16; + optional int32 field130 = 130 [default=0]; + optional bool field12 = 12 [default=true]; + optional bool field17 = 17 [default=true]; + optional bool field13 = 13 [default=true]; + optional bool field14 = 14 [default=true]; + optional int32 field104 = 104 [default=0]; + optional int32 field100 = 100 [default=0]; + optional int32 field101 = 101 [default=0]; + optional string field102 = 102; + optional string field103 = 103; + optional int32 field29 = 29 [default=0]; + optional bool field30 = 30 [default=false]; + optional int32 field60 = 60 [default=-1]; + optional int32 field271 = 271 [default=-1]; + optional int32 field272 = 272 [default=-1]; + optional int32 field150 = 150; + optional int32 field23 = 23 [default=0]; + optional bool field24 = 24 [default=false]; + optional int32 field25 = 25 [default=0]; + optional SpeedMessage1SubMessage field15 = 15; + optional bool field78 = 78; + optional int32 field67 = 67 [default=0]; + optional int32 field68 = 68; + optional int32 field128 = 128 [default=0]; + optional string field129 = 129 [default="xxxxxxxxxxxxxxxxxxxxx"]; + optional int32 field131 = 131 [default=0]; +} + +message SpeedMessage1SubMessage { + optional int32 field1 = 1 [default=0]; + optional int32 field2 = 2 [default=0]; + optional int32 field3 = 3 [default=0]; + optional string field15 = 15; + optional bool field12 = 12 [default=true]; + optional int64 field13 = 13; + optional int64 field14 = 14; + optional int32 field16 = 16; + optional int32 field19 = 19 [default=2]; + optional bool field20 = 20 [default=true]; + optional bool field28 = 28 [default=true]; + optional fixed64 field21 = 21; + optional int32 field22 = 22; + optional bool field23 = 23 [ default=false ]; + optional bool field206 = 206 [default=false]; + optional fixed32 field203 = 203; + optional int32 field204 = 204; + optional string field205 = 205; + optional uint64 field207 = 207; + optional uint64 field300 = 300; +} + +message SpeedMessage2 { + optional string field1 = 1; + optional int64 field3 = 3; + optional int64 field4 = 4; + optional int64 field30 = 30; + optional bool field75 = 75 [default=false]; + optional string field6 = 6; + optional bytes field2 = 2; + optional int32 field21 = 21 [default=0]; + optional int32 field71 = 71; + optional float field25 = 25; + optional int32 field109 = 109 [default=0]; + optional int32 field210 = 210 [default=0]; + optional int32 field211 = 211 [default=0]; + optional int32 field212 = 212 [default=0]; + optional int32 field213 = 213 [default=0]; + optional int32 field216 = 216 [default=0]; + optional int32 field217 = 217 [default=0]; + optional int32 field218 = 218 [default=0]; + optional int32 field220 = 220 [default=0]; + optional int32 field221 = 221 [default=0]; + optional float field222 = 222 [default=0.0]; + optional int32 field63 = 63; + + repeated group Group1 = 10 { + required float field11 = 11; + optional float field26 = 26; + optional string field12 = 12; + optional string field13 = 13; + repeated string field14 = 14; + required uint64 field15 = 15; + optional int32 field5 = 5; + optional string field27 = 27; + optional int32 field28 = 28; + optional string field29 = 29; + optional string field16 = 16; + repeated string field22 = 22; + repeated int32 field73 = 73; + optional int32 field20 = 20 [default=0]; + optional string field24 = 24; + optional SpeedMessage2GroupedMessage field31 = 31; + } + repeated string field128 = 128; + optional int64 field131 = 131; + repeated string field127 = 127; + optional int32 field129 = 129; + repeated int64 field130 = 130; + optional bool field205 = 205 [default=false]; + optional bool field206 = 206 [default=false]; +} + +message SpeedMessage2GroupedMessage { + optional float field1 = 1; + optional float field2 = 2; + optional float field3 = 3 [default=0.0]; + optional bool field4 = 4; + optional bool field5 = 5; + optional bool field6 = 6 [default=true]; + optional bool field7 = 7 [default=false]; + optional float field8 = 8; + optional bool field9 = 9; + optional float field10 = 10; + optional int64 field11 = 11; +} diff --git a/google_messages.proto.bin b/benchmark/google_messages.proto.bin index 0531d7e..0531d7e 100644 --- a/google_messages.proto.bin +++ b/benchmark/google_messages.proto.bin diff --git a/descriptor.c b/descriptor/descriptor.c index d90f6c8..d90f6c8 100644 --- a/descriptor.c +++ b/descriptor/descriptor.c diff --git a/descriptor.h b/descriptor/descriptor.h index 1e7e927..1e7e927 100644 --- a/descriptor.h +++ b/descriptor/descriptor.h diff --git a/upb_context.c b/src/upb_context.c index d857d16..d857d16 100644 --- a/upb_context.c +++ b/src/upb_context.c diff --git a/upb_context.h b/src/upb_context.h index 4ddaed6..4ddaed6 100644 --- a/upb_context.h +++ b/src/upb_context.h diff --git a/upb_enum.c b/src/upb_enum.c index b599c9b..b599c9b 100644 --- a/upb_enum.c +++ b/src/upb_enum.c diff --git a/upb_enum.h b/src/upb_enum.h index 9fea3a4..9fea3a4 100644 --- a/upb_enum.h +++ b/src/upb_enum.h diff --git a/upb_inlinedefs.c b/src/upb_inlinedefs.c index 60863c4..60863c4 100644 --- a/upb_inlinedefs.c +++ b/src/upb_inlinedefs.c diff --git a/upb_msg.c b/src/upb_msg.c index 47a8662..47a8662 100644 --- a/upb_msg.c +++ b/src/upb_msg.c diff --git a/upb_msg.h b/src/upb_msg.h index 8910505..8910505 100644 --- a/upb_msg.h +++ b/src/upb_msg.h diff --git a/upb_parse.c b/src/upb_parse.c index 3a011a6..3a011a6 100644 --- a/upb_parse.c +++ b/src/upb_parse.c diff --git a/upb_parse.h b/src/upb_parse.h index d9db85c..d9db85c 100644 --- a/upb_parse.h +++ b/src/upb_parse.h diff --git a/upb_string.c b/src/upb_string.c index 733bafe..733bafe 100644 --- a/upb_string.c +++ b/src/upb_string.c diff --git a/upb_string.h b/src/upb_string.h index 7a05811..7a05811 100644 --- a/upb_string.h +++ b/src/upb_string.h diff --git a/upb_table.c b/src/upb_table.c index 3bbc7f7..3bbc7f7 100644 --- a/upb_table.c +++ b/src/upb_table.c diff --git a/upb_table.h b/src/upb_table.h index 094ed48..094ed48 100644 --- a/upb_table.h +++ b/src/upb_table.h diff --git a/test_table.cc b/tests/test_table.cc index 0337eaa..0337eaa 100644 --- a/test_table.cc +++ b/tests/test_table.cc diff --git a/test_util.h b/tests/test_util.h index a998a19..a998a19 100644 --- a/test_util.h +++ b/tests/test_util.h |