Giter VIP home page Giter VIP logo

grpc.json.performancetest's Introduction

Grpc vs Json Performance Test on .NET Core 2.0

Benchmarked with BenchmarkDotNet library.

Versions

GRPC library version: 1.4.1

ASP.NET Core version: 2.0, Newtonsoft.Json: 10.0.3

Servers

GRPC: Benchmarked against GRPC server.

Json: Benchmarked against ASP.NET Core 2.0 (Kestrel + MVC framework).

Clients

GRPC: .NET Core 2.0 console app.

Json: .NET Core 2.0 console app.

Json request size

Encoding: UTF8

Formatting: not indented

SmallRequest: 26 chars -> 26 bytes

HugeRequest: 4,828 characters -> 4,828 bytes

GRPC Result

BenchmarkDotNet=v0.10.9, OS=Windows 10 Threshold 2 (10.0.10586)
Processor=Intel Core i7-5500U CPU 2.40GHz (Broadwell), ProcessorCount=4
Frequency=2338332 Hz, Resolution=427.6553 ns, Timer=TSC
.NET Core SDK=2.0.0
  [Host]     : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT
  DefaultJob : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT

Method Mean Error StdDev
SendSmallRequestToServer 138.7 us 2.349 us 2.082 us
SendHugeRequestToServer 277.9 us 5.124 us 5.483 us

Json Result

BenchmarkDotNet=v0.10.9, OS=Windows 10 Threshold 2 (10.0.10586)
Processor=Intel Core i7-5500U CPU 2.40GHz (Broadwell), ProcessorCount=4
Frequency=2338332 Hz, Resolution=427.6553 ns, Timer=TSC
.NET Core SDK=2.0.0
  [Host]     : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT
  DefaultJob : .NET Core 2.0.0 (Framework 4.6.00001.0), 64bit RyuJIT

Method Mean Error StdDev Median
SendSmallRequestToServer 613.5 us 20.30 us 56.26 us 590.5 us
SendHugeRequestToServer 964.1 us 20.12 us 39.71 us 950.1 us

Diagrams

The smaller the better. Y scale is nanosec

Small request

The smaller the better. Y scale is nanosec

Huge request

How to run the tests

Open 2 separate command window and run the servers.

cd "Grpc.Json.PerformanceTest\JsonServer"
dotnet run -c Release
cd "Grpc.Json.PerformanceTest\GrpcServer"
dotnet run -c Release

And then the testrunners:

cd "Grpc.Json.PerformanceTest\JsonClient"
dotnet run -c Release
cd "Grpc.Json.PerformanceTest\GrpcClient"
dotnet run -c Release

grpc.json.performancetest's People

Contributors

peterdeme avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.