Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First pass at C# benchmarks #5802

Merged
merged 2 commits into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ csharp_EXTRA_DIST= \
csharp/src/AddressBook/ListPeople.cs \
csharp/src/AddressBook/Program.cs \
csharp/src/AddressBook/SampleUsage.cs \
csharp/src/Google.Protobuf.Benchmarks/SerializationConfig.cs \
csharp/src/Google.Protobuf.Benchmarks/SerializationBenchmark.cs \
csharp/src/Google.Protobuf.Benchmarks/Program.cs \
csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj \
csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs \
csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs \
csharp/src/Google.Protobuf.Conformance/Conformance.cs \
csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj \
csharp/src/Google.Protobuf.Conformance/Program.cs \
Expand Down
17 changes: 16 additions & 1 deletion benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ include PHP protobuf's src and build the c extension if required.
### Node.js
Node.js benchmark need [node](https://nodejs.org/en/)(higher than V6) and [npm](https://www.npmjs.com/) package manager installed. This benchmark is using the [benchmark](https://www.npmjs.com/package/benchmark) framework to test, which needn't to manually install. And another prerequisite is [protobuf js](https://github.com/protocolbuffers/protobuf/tree/master/js), which needn't to manually install either

### C#
The C# benchmark code is built as part of the main Google.Protobuf
solution. It requires the .NET Core SDK, and depends on
[BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet), which
will be downloaded automatically.

### Big data

There's some optional big testing data which is not included in the directory
Expand All @@ -74,7 +80,7 @@ initially, you need to run the following command to download the testing data:
$ ./download_data.sh
```

After doing this the big data file will automaticly generated in the
After doing this the big data file will automatically generated in the
benchmark directory.

## Run instructions
Expand Down Expand Up @@ -209,6 +215,15 @@ $ make js-benchmark
$ ./js-benchmark $(specific generated dataset file name)
```

### C#
From `csharp/src/Google.Protobuf.Benchmarks`, run:

```
$ dotnet run -c Release
```

We intend to add support for this within the makefile in due course.

## Benchmark datasets

Each data set is in the format of benchmarks.proto:
Expand Down
3 changes: 3 additions & 0 deletions csharp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ mono/*.exe
mono/*.dll
lib/protoc.exe
*.ncrunch*

# Benchmark output
BenchmarkDotNet.Artifacts/
6 changes: 6 additions & 0 deletions csharp/generate_protos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@ $PROTOC -Iexamples -Isrc --csharp_out=csharp/src/AddressBook \

$PROTOC -Iconformance -Isrc --csharp_out=csharp/src/Google.Protobuf.Conformance \
conformance/conformance.proto

# Benchmark protos
$PROTOC -Ibenchmarks \
benchmarks/datasets/google_message1/proto3/*.proto \
benchmarks/benchmarks.proto \
--csharp_out=csharp/src/Google.Protobuf.Benchmarks
Loading