Giter VIP home page Giter VIP logo

slow_blink's Introduction

SlowBlink

SlowBlink is a Ruby implementation of Blink Protocol.

The Blink Protocol is serialisation specification that uses a schema to define the structure of binary messages. The wire format is optimised for size and codec efficiency which makes it a useful format for applications operating over constrained networks.

SlowBlink is a tool to support rapid development of telemetry systems. It features an integrated schema parser, a dynamic message generator, and an extensible codec generator (to generate codecs in languages other than Ruby).

Build Status Gem Version

Highlights

  • Implements Blink Specification beta4-2013-06-14.
  • Integrated schema parser
  • Dynamic message class generator (no code generation step)
    • Produces anonymous classes derived from SlowBlink::Message::Group
    • Does not generate constants
    • Supports blink tag specification and compact mode serialisation
  • Extensible ERB based codec generator

Todo

  • More tests
  • Support SlowBlink::Message::DATE
  • More debug features (error messages involving anonymous classes are confusing)
  • Annotations are parsed but ignored

Installation

gem install slow_blink

Requires Ruby 2.0 and support for building native extensions.

Examples

see examples.

Documentation

  • SlowBlink interface documentation can be viewed online
  • Blink Specification is maintained here
  • The version of Blink Specification implemented by SlowBlink is included in this repository under specification/blink

Typical Performance

schema with data:

    InsertOrder/1 ->
        string Symbol,  # set to "IBM"
        string OrderId, # set to "ABC123"
        u32 Price,      # set to 125
        u32 Quantity    # set to 1000

compact form:

    \x0F\x01\x03\x49\x42\x4D\x06\x41\x42\x43\x31\x32\x33\x7D\xA8\x0F  (16 bytes)

benchmark:
                                                         user     system      total        real
100000 x Schema.new                                  3.630000   0.550000   4.180000 (  4.176857)
100000 x Message::Model.new                          3.870000   0.000000   3.870000 (  3.873298)
100000 x Message::Model#group.new#encode_compact     1.300000   0.000000   1.300000 (  1.295605)
100000 x Message::Model#decode_compact               1.360000   0.000000   1.360000 (  1.362102)

parse                 23941 schema/s
generate              25817 model/s
initialise and encode 77184 message/s    (1234944 Bytes/s)
decode                73415 message/s    (1174640 Bytes/s)

running ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
on Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz

Run the same test by calling rake benchmark.

License

SlowBlink has an MIT license.

Thanks

Many thanks to the authors of Blink Protocol.

slow_blink's People

Contributors

cjhdev avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

slow_blink's Issues

reference to a reference syntax cannot be parsed

The following syntax cannot be parsed by the GLR parser grammar:

refref = u8
ref = refref
group -> 
    ref myfield

The problem seems to be with the refref definition (i.e. "reference to a reference").
I'm not sure if it's fixable so will leave this as a known issue for now.

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.