Giter VIP home page Giter VIP logo

jsonperf's Introduction

jsonPerf

Kitura-based JSON serialization performance testcase. A number of routes are provided for testing the performance of serializing Int, UInt, Double and Float number types with either a default value, or one that you provide. There are also routes for Bool and purely String types.

The serialized payload is configurable via the following environment variables, which should be set prior to launching the application:

  • TESTVALUE: sets the number to be serialized. (default 1234)
  • TESTCOUNT: sets the number of elements in the dictionary being serialized. (default 10)

Steps for measuring using the 'Kitura-Bench' scripts

  1. Build the project
git clone https://github.com/djones6/jsonPerf ~/jsonPerf
cd ~/jsonPerf
swiftenv local <baseline swift build>
swift build -c release --build-path=baselineBuild
swiftenv local <new swift build>
swift build -c release --build-path=newBuild
  1. Get the driver scripts and prereqs
git clone https://github.com/djones6/Kitura-Bench ~/kiturabench

For Linux, you need these packages:

sudo apt-get install numactl sysstat
  1. Get the 'wrk' tool (my fork, 'interval' branch adds the -i option to provide periodic throughput measurements)
git clone https://github.com/djones6/wrk.git -b interval
cd wrk
make

This will build wrk, then you need to put it on your path:

export PATH=$PATH:$HOME/wrk

(you could add this to your .bashrc)

  1. Run a compare:
env TESTVALUE=123456 TESTCOUNT=20 URL=http://localhost:8080/jsonInt ITERATIONS=5 DURATION=60 ~/kiturabench/compare.sh ~/jsonPerf/baselineBuild/release/JSON ~/jsonPerf/newBuild/release/JSON

If you want to test your builds first, just launch the binary you built and then point your browser to eg: http://localhost:8080/jsonInt

You can launch it manually like this: env TESTVALUE=123456 TESTCOUNT=20 newBuild/release/JSON

jsonperf's People

Contributors

djones6 avatar

Watchers

 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.