Giter Club home page Giter Club logo

php-binary-json's Introduction

PHP Binary Json

Bson written in C, wrapped in php extension.

Reference

Test Conditions

Hackintosh laptop: i3 2.2Ghz, 4GB of RAM, over TCP on localhost.

Message count: 100,000 messages

Test Results for one field

"msgid" as a name, with the message number as the value

BSON

  • Average per message encoding: 1140 ns
  • Average per message decoding: 245 ns
  • Average Bytes per message: 16 bytes

Protobuf

  • Average per message encoding: 3981 ns
  • Average per message decoding: 4036 ns
  • Average Bytes per message: 15 bytes

YAML

  • Average per message encoding: 244490 ns
  • Average per message decoding: 412915 ns
  • Average Bytes per message: Not recorded
  • Test Results for 2 fields

Putting in two numbers, in random field order and sending to the server.

BSON

  • Average per message encoding: Not recorded
  • Average per message decoding: 299 ns
  • Average Bytes per message: 32 bytes

Protobuf

  • Average per message encoding: Not recorded
  • Average per message decoding: 7422 ns
  • Average Bytes per message: 57 bytes

YAML

  • Average per message encoding: Not recorded
  • Average per message decoding: 316531 ns
  • Average Bytes per message: 32 bytes
  • Test results for 50 fields

Putting in 50 fields, randomly sorted, each with a number consisting of the current message id multiplied by the index of the shuffled field name array. Decoding time includes access to "field_1" which is in a random location within the entire data set.

BSON

  • Average per message encoding: 14196 ns
  • Average per message decoding: 302 ns
  • Average Bytes per message: 695 bytes

Protobuf

  • Average per message encoding: 110480 ns
  • Average per message decoding: 106609 ns
  • Average Bytes per message: 695 bytes

YAML

  • Average per message encoding: 7135667 ns
  • Average per message decoding: 4893947 ns
  • Average Bytes per message: 853 bytes

php-binary-json's People

Contributors

guweigang avatar

Stargazers

 avatar  avatar  avatar donotgiveafuck avatar mickelfeng avatar sasezaki avatar  avatar

Watchers

 avatar Shang Yuanchun avatar James Cloos avatar  avatar mickelfeng avatar  avatar  avatar

Forkers

lucciano guoyu07

php-binary-json's Issues

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.