Fast Binary Encoding is ultra fast and universal serialization solution for C++, C#, Go, Java, JavaScript, Kotlin, Python, Ruby, Swift

Overview

Fast Binary Encoding (FBE)

Awesome C++ Linux build status OSX build status Cygwin build status MSYS2 build status MinGW build status Windows build status

Fast Binary Encoding allows to describe any domain models, business objects, complex data structures, client/server requests & responses and generate native code for different programming languages and platforms.

Fast Binary Encoding documentation
Fast Binary Encoding downloads
Fast Binary Encoding specification

Performance comparison to other protocols can be found here:

Protocol Message size Serialization time Deserialization time
Cap'n'Proto 208 bytes 558 ns 359 ns
FastBinaryEncoding 234 bytes 66 ns 82 ns
FlatBuffers 280 bytes 830 ns 290 ns
Protobuf 120 bytes 628 ns 759 ns
JSON 301 bytes 740 ns 500 ns

Typical usage workflow is the following:

  1. Create domain model using base types, enums, flags and structs
  2. Generate domain model for any supported programming languages (C++, C#, Go, Java, JavaScript, Kotlin, Python, Ruby, Swift)
  3. Build domain model library
  4. Serialize/Deserialize objects from the domain model in unified, fast and compact FastBinaryEncoding (FBE) format
  5. JSON convert objects from the domain model in order to use them in Web API
  6. Implement Sender/Receiver interfaces to create a communication protocol

Sample projects:

Contents

Features

Requirements

Optional:

How to build?

Install gil (git links) tool

pip3 install gil

Setup repository

git clone https://github.com/chronoxor/FastBinaryEncoding.git
cd FastBinaryEncoding
gil update

Linux

cd build
./unix.sh

OSX

cd build
./unix.sh

Windows (Cygwin)

cd build
unix.bat

Windows (MSYS2)

cd build
unix.bat

Windows (MinGW)

cd build
mingw.bat

Windows (Visual Studio)

cd build
vs.bat

Create domain model

To use Fast Binary Encoding you should provide a domain model (aka business objects). A domain model is a set of enums, flags and structures that relate to each other and might be aggregated in some hierarchy.

Fast Binary Encoding (FBE) format specification

There is a sample domain model which describes Account-Balance-Orders relation of some abstract trading platform:

// Package declaration
package proto

// Domain declaration
domain com.chronoxor

// Order side declaration
enum OrderSide : byte
{
    buy;
    sell;
}

// Order type declaration
enum OrderType : byte
{
    market;
    limit;
    stop;
}

// Order declaration
struct Order
{
    [key] int32 uid;
    string symbol;
    OrderSide side;
    OrderType type;
    double price = 0.0;
    double volume = 0.0;
}

// Account balance declaration
struct Balance
{
    [key] string currency;
    double amount = 0.0;
}

// Account state declaration
flags State : byte
{
    unknown = 0x00;
    invalid = 0x01;
    initialized = 0x02;
    calculated = 0x04;
    broken = 0x08;
    good = initialized | calculated;
    bad = unknown | invalid | broken;
}

// Account declaration
struct Account
{
    [key] int32 uid;
    string name;
    State state = State.initialized | State.bad;
    Balance wallet;
    Balance? asset;
    Order[] orders;
}

Generate domain model

The next step is a domain model compilation using 'fbec' compiler which will create a generated code for required programming language.

The following command will create a C++ generated code:

fbec --c++ --input=proto.fbe --output=.

All possible options for the 'fbec' compiler are the following:

Usage: fbec [options]

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  -h HELP, --help=HELP  Show help
  -i INPUT, --input=INPUT
                        Input path
  -o OUTPUT, --output=OUTPUT
                        Output path
  -q, --quiet           Launch in quiet mode. No progress will be shown!
  -n INDENT, --indent=INDENT
                        Format indent. Default: 0
  -t, --tabs            Format with tabs. Default: off
  --cpp                 Generate C++ code
  --cpp-logging         Generate C++ logging code
  --csharp              Generate C# code
  --go                  Generate Go code
  --java                Generate Java code
  --javascript          Generate JavaScript code
  --kotlin              Generate Kotlin code
  --python              Generate Python code
  --ruby                Generate Ruby code
  --swift               Generate Swift code
  --final               Generate Final serialization code
  --json                Generate JSON serialization code
  --proto               Generate Sender/Receiver protocol code

Build domain model

Generated domain model is represented with source code for the particular language. Just add it to your project and build it. There are several issues and dependencies that should be mentioned:

C++

  • C++ standard is limited to C++17 in order to have the implementation of std::optional;
  • C++ has no native support for decimal type. Currently decimal type is emulated with a double type. FBE does not use GMPLib because of heavy dependency in generated source code;
  • JSON serialization is implemented using RapidJSON library. Therefore its headers should be available (header only library);

C#

  • JSON serialization is implemented using Json.NET library. Therefore it should be imported using NuGet;
  • Fast JSON serialization libraty is also available - Utf8Json . If you want to try it, you should import is with NuGet and build domain model with 'UTF8JSON' definition;

Go

  • Assert testing is based on stretchr/testify package (go get github.com/stretchr/testify);
  • JSON serialization is based on jsoniter package (go get github.com/json-iterator/go);
  • Decimal type is based on shopspring/decimal package (go get github.com/shopspring/decimal);
  • UUID type is based on google/uuid package (go get github.com/google/uuid);

Java

  • JSON serialization is implemented using Gson package. Therefore it should be imported using Maven;

JavaScript

  • JavaScript domain model is implemented using ECMAScript 6 (classes, etc.);
  • JSON serialization of set, map and hash types is limited to key with string type;

Kotlin

Python

Ruby

  • Some Ruby dependencies should be installed from Gems:
gem install json
gem install uuidtools

Swift

  • Swift domain model is implemented using uses SwiftPM as its build tool;
  • JSON serialization is implemented using Codable protocol;
  • JSON serialization of set, map and hash types is limited to key with string type.

FBE serialization

Fast Binary Encoding (FBE) is a fast and compact binary format of representing single domain models in different programming languages and platforms. Also FBE format solves protocol versioning problem.

Follow the steps below in order to serialize any domain object:

  1. Create a new domain object and fill its fields and collections (proto::Account account);
  2. Create a domain model with a write buffer (FBE::proto::AccountModelFBE::WriteBuffer writer)
  3. Serialize the domain object into the domain model buffer (writer.serialize(account))
  4. (Optional) Verify the domain object in the domain model buffer (assert(writer.verify()))
  5. Access the domain model buffer to store or send data (writer.buffer())

Follow the steps below in order to deserialize any domain object:

  1. Create a domain model with a read buffer (FBE::proto::AccountModelFBE::ReadBuffer reader)
  2. Attach a source buffer to the domain model (reader.attach(writer.buffer()))
  3. (Optional) Verify the domain object in the domain model buffer (assert(reader.verify()))
  4. Deserialize the domain object from the domain model buffer (reader.deserialize(account))

Here is an exmple of FBE serialization in C++ language:

#include "../proto/proto_models.h"

#include <iostream>

int main(int argc, char** argv)
{
    // Create a new account with some orders
    proto::Account account = { 1, "Test", proto::State::good, { "USD", 1000.0 }, std::make_optional<proto::Balance>({ "EUR", 100.0 }), {} };
    account.orders.emplace_back(1, "EURUSD", proto::OrderSide::buy, proto::OrderType::market, 1.23456, 1000.0);
    account.orders.emplace_back(2, "EURUSD", proto::OrderSide::sell, proto::OrderType::limit, 1.0, 100.0);
    account.orders.emplace_back(3, "EURUSD", proto::OrderSide::buy, proto::OrderType::stop, 1.5, 10.0);

    // Serialize the account to the FBE stream
    FBE::proto::AccountModel<FBE::WriteBuffer> writer;
    writer.serialize(account);
    assert(writer.verify());

    // Show the serialized FBE size
    std::cout << "FBE size: " << writer.buffer().size() << std::endl;

    // Deserialize the account from the FBE stream
    FBE::proto::AccountModel<FBE::ReadBuffer> reader;
    reader.attach(writer.buffer());
    assert(reader.verify());
    reader.deserialize(account);

    // Show account content
    std::cout << std::endl;
    std::cout << account;

    return 0;
}

Output is the following:

FBE size: 252

Account(
  uid=1,
  name="Test",
  state=initialized|calculated|good,
  wallet=Balance(currency="USD",amount=1000),
  asset=Balance(currency="EUR",amount=100),
  orders=[3][
    Order(uid=1,symbol="EURUSD",side=buy,type=market,price=1.23456,volume=1000),
    Order(uid=2,symbol="EURUSD",side=sell,type=limit,price=1,volume=100),
    Order(uid=3,symbol="EURUSD",side=buy,type=stop,price=1.5,volume=10)
  ]
)

FBE final serialization

It is possible to achieve more serialization speed if your protocol is mature enough so you can fix its final version and disable versioning which requires extra size and time to process.

Protocol Message size Serialization time Deserialization time Verify time
FBE 252 bytes 88 ns 98 ns 33 ns
FBE final 152 bytes 57 ns 81 ns 28 ns

Final domain model can be compiled with --final flag. As the result additional final models will be available for serialization.

Follow the steps below in order to serialize any domain object in final format:

  1. Create a new domain object and fill its fields and collections (proto::Account account);
  2. Create a domain final model with a write buffer (FBE::proto::AccountFinalModelFBE::WriteBuffer writer)
  3. Serialize the domain object into the domain model buffer (writer.serialize(account))
  4. (Optional) Verify the domain object in the domain model buffer (assert(writer.verify()))
  5. Access the domain model buffer to store or send data (writer.buffer())

Follow the steps below in order to deserialize any domain object:

  1. Create a domain final model with a read buffer (FBE::proto::AccountFinalModelFBE::ReadBuffer reader)
  2. Attach a source buffer to the domain final model (reader.attach(writer.buffer()))
  3. (Optional) Verify the domain object in the domain model buffer (assert(reader.verify()))
  4. Deserialize the domain object from the domain model buffer (reader.deserialize(account))

Here is an exmple of FBE final serialization in C++ language:

#include "../proto/proto_models.h"

#include <iostream>

int main(int argc, char** argv)
{
    // Create a new account with some orders
    proto::Account account = { 1, "Test", proto::State::good, { "USD", 1000.0 }, std::make_optional<proto::Balance>({ "EUR", 100.0 }), {} };
    account.orders.emplace_back(1, "EURUSD", proto::OrderSide::buy, proto::OrderType::market, 1.23456, 1000.0);
    account.orders.emplace_back(2, "EURUSD", proto::OrderSide::sell, proto::OrderType::limit, 1.0, 100.0);
    account.orders.emplace_back(3, "EURUSD", proto::OrderSide::buy, proto::OrderType::stop, 1.5, 10.0);

    // Serialize the account to the FBE stream
    FBE::proto::AccountFinalModel<FBE::WriteBuffer> writer;
    writer.serialize(account);
    assert(writer.verify());

    // Show the serialized FBE size
    std::cout << "FBE final size: " << writer.buffer().size() << std::endl;

    // Deserialize the account from the FBE stream
    FBE::proto::AccountFinalModel<FBE::ReadBuffer> reader;
    reader.attach(writer.buffer());
    assert(reader.verify());
    reader.deserialize(account);

    // Show account content
    std::cout << std::endl;
    std::cout << account;

    return 0;
}

Output is the following:

FBE final size: 152

Account(
  uid=1,
  name="Test",
  state=initialized|calculated|good,
  wallet=Balance(currency="USD",amount=1000),
  asset=Balance(currency="EUR",amount=100),
  orders=[3][
    Order(uid=1,symbol="EURUSD",side=buy,type=market,price=1.23456,volume=1000),
    Order(uid=2,symbol="EURUSD",side=sell,type=limit,price=1,volume=100),
    Order(uid=3,symbol="EURUSD",side=buy,type=stop,price=1.5,volume=10)
  ]
)

JSON serialization

If the domain model compiled with --json flag, then JSON serialization code will be generated in all domain objects. As the result each domain object can be serialized/deserialized into/from JSON format.

Please note that some programming languages have native JSON support (JavaScript, Python). Other languages requires third-party library to get work with JSON:

Here is an exmple of JSON serialization in C++ language:

#include "../proto/proto.h"

#include <iostream>

int main(int argc, char** argv)
{
    // Create a new account with some orders
    proto::Account account = { 1, "Test", proto::State::good, { "USD", 1000.0 }, std::make_optional<proto::Balance>({ "EUR", 100.0 }), {} };
    account.orders.emplace_back(1, "EURUSD", proto::OrderSide::buy, proto::OrderType::market, 1.23456, 1000.0);
    account.orders.emplace_back(2, "EURUSD", proto::OrderSide::sell, proto::OrderType::limit, 1.0, 100.0);
    account.orders.emplace_back(3, "EURUSD", proto::OrderSide::buy, proto::OrderType::stop, 1.5, 10.0);

    // Serialize the account to the JSON stream
    rapidjson::StringBuffer buffer;
    rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
    FBE::JSON::to_json(writer, account);

    // Show the serialized JSON and its size
    std::cout << "JSON: " << buffer.GetString() << std::endl;
    std::cout << "JSON size: " << buffer.GetSize() << std::endl;

    // Parse the JSON document
    rapidjson::Document json;
    json.Parse(buffer.GetString());

    // Deserialize the account from the JSON stream
    FBE::JSON::from_json(json, account);

    // Show account content
    std::cout << std::endl;
    std::cout << account;

    return 0;
}

Output is the following:

JSON: {
  "uid":1,
  "name":
  "Test",
  "state":6,
  "wallet":{"currency":"USD","amount":1000.0},
  "asset":{"currency":"EUR","amount":100.0},
  "orders":[
    {"uid":1,"symbol":"EURUSD","side":0,"type":0,"price":1.23456,"volume":1000.0},
    {"uid":2,"symbol":"EURUSD","side":1,"type":1,"price":1.0,"volume":100.0},
    {"uid":3,"symbol":"EURUSD","side":0,"type":2,"price":1.5,"volume":10.0}
  ]
}
JSON size: 353

Account(
  uid=1,
  name="Test",
  state=initialized|calculated|good,
  wallet=Balance(currency="USD",amount=1000),
  asset=Balance(currency="EUR",amount=100),
  orders=[3][
    Order(uid=1,symbol="EURUSD",side=buy,type=market,price=1.23456,volume=1000),
    Order(uid=2,symbol="EURUSD",side=sell,type=limit,price=1,volume=100),
    Order(uid=3,symbol="EURUSD",side=buy,type=stop,price=1.5,volume=10)
  ]
)

Packages and import

Packages are declared with package name and structs offset (optional). Offset will be add to incremented structure type if is was not provided explicit.

Here is an example of the simple package declaration:

// Package declaration. Offset is 0.
package proto

// Struct type number is 1 (proto offset 0 + 1)
struct Struct1
{
    ...
}

// Struct type number is 2 (proto offset 0 + 2)
struct Struct2
{
    ...
}

One package can be imported into another and all enums, flags and structs can be reused in the current package. Package offset is used here to avoid structs types intersection:

// Package declaration. Offset is 10.
package protoex offset 10

// Package import
import proto

// Struct type number is 11 (protoex offset 10 + 1)
struct Struct11
{
    // Struct1 is reused form the imported package
    proto.Struct1 s1;
    ...
}

// Struct type number is 12 (protoex offset 10 + 2)
struct Struct12
{
    ...
}

Multiple package import is possible as well:

// Package declaration. Offset is 100.
package test offset 100

// Package import
import proto
import protoex

...

Package import is implemented using:

  • #include "..." directive in C++
  • Namespaces in C#
  • Packages in Go
  • Packages in Java and Kotlin
  • Modules in JavaScript
  • Modules in Python
  • Ruby require statement

Struct keys

Some of struct fileds (one or many) can be marked with '[key]' attribute. As the result corresponding compare operators will be generated which allow to compare two instances of the struct (equality, ordering, hashing) by marked fields. This ability allows to use the struct as a key in associative map and hash containers.

Example below demonstrates the usage of '[key]' attribute:

struct MyKeyStruct
{
    [key] int32 uid;
    [key] stirng login;
    string name;
    string address;
}

After code generation for C++ language the following comparable class will be generated:

struct MyKeyStruct
{
    int32_t uid;
    ::sample::stirng login;
    std::string name;
    std::string address;

    ...

    bool operator==(const MyKeyStruct& other) const noexcept
    {
        return (
            (uid == other.uid)
            && (login == other.login)
            );
    }
    bool operator!=(const MyKeyStruct& other) const noexcept { return !operator==(other); }
    bool operator<(const MyKeyStruct& other) const noexcept
    {
        if (uid < other.uid)
            return true;
        if (other.uid < uid)
            return false;
        if (login < other.login)
            return true;
        if (other.login < login)
            return false;
        return false;
    }
    bool operator<=(const MyKeyStruct& other) const noexcept { return operator<(other) || operator==(other); }
    bool operator>(const MyKeyStruct& other) const noexcept { return !operator<=(other); }
    bool operator>=(const MyKeyStruct& other) const noexcept { return !operator<(other); }

    ...
};

Struct numeration

Struct type numbers are automatically increased until you provide it manually. There are two possibilities:

  1. Shift the current struct type number using '(+X)' suffix. As the result all new structs will have incremented type.
  2. Force set struct type number using '(X)' of '(base)' suffix. It will affect only one struct.

Example below demonstrates the idea:

// Package declaration. Offset is 0.
package proto

// Struct type number is 1 (implicit declared)
struct Struct1
{
    ...
}

// Struct type number is 2 (implicit declared)
struct Struct2
{
    ...
}

// Struct type number is 10 (explicit declared, shifted to 10)
struct Struct10(+10)
{
    ...
}

// Struct type number is 11 (implicit declared)
struct Struct11
{
    ...
}

// Struct type number is 100 (explicit declared, forced to 100)
struct Struct100(100)
{
    ...
}

// Struct type number is 12 (implicit declared)
struct Struct12
{
    ...
}

Struct inheritance

Structs can be inherited from another struct. In this case all fields from the base struct will be present in a child one.

package proto

// Struct type number is 1
struct StructBase
{
    bool f1;
    int8 f2;
}

// Struct type number is 2
struct StructChild : StructBase
{
    // bool f1 - will be inherited from StructBase
    // int8 f2 - will be inherited from StructBase
    int16 f3;
    int32 f4;
}

Also it is possible to reuse the base struct type number in a child one using '= base' operator. It is useful when you extend the struct from third-party imported package:

// Package declaration. Offset is 10.
package protoex offset 10

// Package import
import proto

// Struct type number is 1
struct StructChild(base) : proto.StructBase
{
    // bool f1 - will be inherited from proto.StructBase
    // int8 f2 - will be inherited from proto.StructBase
    int16 f3;
    int32 f4;
}

Versioning

Versioning is simple with Fast Binary Encoding.

Assume you have an original protocol:

package proto

enum MyEnum
{
    value1;
    value2;
}

flags MyFlags
{
    none = 0x00;
    flag1 = 0x01;
    flag2 = 0x02;
    flag3 = 0x04;
}

struct MyStruct
{
    bool field1;
    byte field2;
    char field3;
}

You need to extend it with new enum, flag and struct values. Just add required values to the end of the corresponding declarations:

package proto

enum MyEnum
{
    value1;
    value2;
    value3; // New value
    value4; // New value
}

flags MyFlags
{
    none = 0x00;
    flag1 = 0x01;
    flag2 = 0x02;
    flag3 = 0x04;
    flag4 = 0x08; // New value
    flag5 = 0x10; // New value
}

struct MyStruct
{
    bool field1;
    byte field2;
    char field3;
    int32 field4;          // New field (default value is 0)
    int64 field5 = 123456; // New field (default value is 123456)
}

Now you can serialize and deserialize structs in different combinations:

  • Serialize old, deserialize old - nothing will be lost (best case);
  • Serialize old, deserialize new - all old fields will be deserialized, all new fields will be initialized with 0 or default values according to definition;
  • Serialize new, deserialize old - all old fields will be deserialized, all new fields will be discarded;
  • Serialize new, deserialize new - nothing will be lost (best case);

Versioning of the third-party protocol

If you are not able to modify some third-party protocol, you can still have a solution of extending it. Just create a new protocol and import third-party one into it. Then extend structs with inheritance:

package protoex

import proto

struct MyStructEx(base) : proto.MyStruct
{
    int32 field4;          // New field (default value is 0)
    int64 field5 = 123456; // New field (default value is 123456)
}

Sender/Receiver protocol

If the domain model compiled with --sender flag, then Sender/Receiver protocol code will be generated.

Sender interface contains 'send(struct)' methods for all domain model structs. Also it has abstract 'onSend(data, size)' method which should be implemented to send serialized data to a socket, pipe, etc.

Receiver interface contains 'onReceive(struct)' handlers for all domain model structs. Also it has public 'onReceive(type, data, size)' method which should be used to feed the Receiver with received data from a socket, pipe, etc.

Here is an exmple of using Sender/Receiver communication protocol in C++ language:

#include "../proto/proto_protocol.h"

#include <iostream>

class MySender : public FBE::proto::Sender<FBE::WriteBuffer>
{
protected:
    size_t onSend(const void* data, size_t size) override
    {
        // Send nothing...
        return 0;
    }

    void onSendLog(const std::string& message) const override
    {
        std::cout << "onSend: " << message << std::endl;
    }
};

class MyReceiver : public FBE::proto::Receiver<FBE::WriteBuffer>
{
protected:
    void onReceive(const proto::Order& value) override {}
    void onReceive(const proto::Balance& value) override {}
    void onReceive(const proto::Account& value) override {}

    void onReceiveLog(const std::string& message) const override
    {
        std::cout << "onReceive: " << message << std::endl;
    }
};

int main(int argc, char** argv)
{
    MySender sender;

    // Enable logging
    sender.logging(true);

    // Create and send a new order
    proto::Order order = { 1, "EURUSD", proto::OrderSide::buy, proto::OrderType::market, 1.23456, 1000.0 };
    sender.send(order);

    // Create and send a new balance wallet
    proto::Balance balance = { "USD", 1000.0 };
    sender.send(balance);

    // Create and send a new account with some orders
    proto::Account account = { 1, "Test", proto::State::good, { "USD", 1000.0 }, std::make_optional<proto::Balance>({ "EUR", 100.0 }), {} };
    account.orders.emplace_back(1, "EURUSD", proto::OrderSide::buy, proto::OrderType::market, 1.23456, 1000.0);
    account.orders.emplace_back(2, "EURUSD", proto::OrderSide::sell, proto::OrderType::limit, 1.0, 100.0);
    account.orders.emplace_back(3, "EURUSD", proto::OrderSide::buy, proto::OrderType::stop, 1.5, 10.0);
    sender.send(account);

    MyReceiver receiver;

    // Enable logging
    receiver.logging(true);

    // Receive all data from the sender
    receiver.receive(sender.buffer().data(), sender.buffer().size());

    return 0;
}

Output is the following:

onSend: Order(uid=1,symbol="EURUSD",side=buy,type=market,price=1.23456,volume=1000)
onSend: Balance(currency="USD",amount=1000)
onSend: Account(uid=1,name="Test",state=initialized|calculated|good,wallet=Balance(currency="USD",amount=1000),asset=Balance(currency="EUR",amount=100),orders=[3][Order(uid=1,symbol="EURUSD",side=buy,type=market,price=1.23456,volume=1000),Order(uid=2,symbol="EURUSD",side=sell,type=limit,price=1,volume=100),Order(uid=3,symbol="EURUSD",side=buy,type=stop,price=1.5,volume=10)])
onReceive: Order(uid=1,symbol="EURUSD",side=buy,type=market,price=1.23456,volume=1000)
onReceive: Balance(currency="USD",amount=1000)
onReceive: Account(uid=1,name="Test",state=initialized|calculated|good,wallet=Balance(currency="USD",amount=1000),asset=Balance(currency="EUR",amount=100),orders=[3][Order(uid=1,symbol="EURUSD",side=buy,type=market,price=1.23456,volume=1000),Order(uid=2,symbol="EURUSD",side=sell,type=limit,price=1,volume=100),Order(uid=3,symbol="EURUSD",side=buy,type=stop,price=1.5,volume=10)])

Performance benchmarks

All benchmarks use the same domain model to create a single account with three orders:

Account account = { 1, "Test", State::good, { "USD", 1000.0 }, std::make_optional<Balance>({ "EUR", 100.0 }), {} };
account.orders.emplace_back(1, "EURUSD", OrderSide::buy, OrderType::market, 1.23456, 1000.0);
account.orders.emplace_back(2, "EURUSD", OrderSide::sell, OrderType::limit, 1.0, 100.0);
account.orders.emplace_back(3, "EURUSD", OrderSide::buy, OrderType::stop, 1.5, 10.0);

Benchmark 1: Serialization

Serialization benchmark C++ code:

BENCHMARK_FIXTURE(SerializationFixture, "Serialize")
{
    // Reset FBE stream
    writer.reset();

    // Serialize the account to the FBE stream
    writer.serialize(account);
}

Serialization benchmark results:

Language & Platform Message size Serialization rate Serialization time
C++ Win64 252 bytes 10 416 667 ops/s 96 ns
C++ Win64 (Final) 152 bytes 16 129 032 ops/s 62 ns
C++ Win64 (JSON) 353 bytes 926 784 ops/s 1 079 ns
C# Win64 252 bytes 1 432 665 ops/s 698 ns
C# Win64 (Final) 152 bytes 1 597 444 ops/s 626 ns
C# Win64 (JSON) 341 bytes 434 783 ops/s 2 300 ns
Go Win64 252 bytes 2 739 726 ops/s 365 ns
Go Win64 (Final) 152 bytes 2 949 852 ops/s 339 ns
Go Win64 (JSON) 341 bytes 258 732 ops/s 3 865 ns
Java Win64 252 bytes 4 247 162 ops/s 236 ns
Java Win64 (Final) 152 bytes 4 883 205 ops/s 205 ns
Java Win64 (JSON) 353 bytes 213 983 ops/s 4 673 ns
JavaScript Win64 252 bytes 93 416 ops/s 10 705 ns
JavaScript Win64 (Final) 152 bytes 112 665 ops/s 8 876 ns
JavaScript Win64 (JSON) 341 bytes 217 637 ops/s 4 595 ns
Kotlin Win64 252 bytes 3 546 694 ops/s 282 ns
Kotlin Win64 (Final) 152 bytes 4 096 406 ops/s 244 ns
Kotlin Win64 (JSON) 353 bytes 185 788 ops/s 5 382 ns
Python Win64 252 bytes 9 434 ops/s 105 999 ns
Python Win64 (Final) 152 bytes 11 635 ops/s 85 945 ns
Python Win64 (JSON) 324 bytes 61 737 ops/s 16 198 ns
Ruby Win64 252 bytes 23 013 ops/s 43 453 ns
Ruby Win64 (Final) 152 bytes 33 361 ops/s 29 975 ns
Ruby Win64 (JSON) 353 bytes 50 842 ops/s 19 669 ns
Swift macOS 252 bytes 74 002 ops/s 13 513 ns
Swift macOS (Final) 152 bytes 100 755 ops/s 9 925 ns
Swift macOS (JSON) 353 bytes 18 534 ops/s 53 953 ns

Benchmark 2: Deserialization

Deserialization benchmark C++ code:

BENCHMARK_FIXTURE(DeserializationFixture, "Deserialize")
{
    // Deserialize the account from the FBE stream
    reader.deserialize(deserialized);
}

Deserialization benchmark results:

Language & Platform Message size Deserialization rate Deserialization time
C++ Win64 252 bytes 9 523 810 ops/s 105 ns
C++ Win64 (Final) 152 bytes 10 989 011 ops/s 91 ns
C++ Win64 (JSON) 353 bytes 1 375 516 ops/s 727 ns
C# Win64 252 bytes 1 014 199 ops/s 986 ns
C# Win64 (Final) 152 bytes 1 607 717 ops/s 622 ns
C# Win64 (JSON) 341 bytes 258 532 ops/s 3 868 ns
Go Win64 252 bytes 1 510 574 ops/s 662 ns
Go Win64 (Final) 152 bytes 1 540 832 ops/s 649 ns
Go Win64 (JSON) 341 bytes 251 825 ops/s 3 971 ns
Java Win64 252 bytes 2 688 084 ops/s 372 ns
Java Win64 (Final) 152 bytes 3 036 020 ops/s 329 ns
Java Win64 (JSON) 353 bytes 308 675 ops/s 3 240 ns
JavaScript Win64 252 bytes 133 892 ops/s 7 469 ns
JavaScript Win64 (Final) 152 bytes 292 273 ops/s 3 422 ns
JavaScript Win64 (JSON) 341 bytes 289 417 ops/s 3 455 ns
Kotlin Win64 252 bytes 2 280 923 ops/s 438 ns
Kotlin Win64 (Final) 152 bytes 2 652 728 ops/s 277 ns
Kotlin Win64 (JSON) 353 bytes 250 524 ops/s 3 992 ns
Python Win64 252 bytes 8 305 ops/s 120 411 ns
Python Win64 (Final) 152 bytes 11 661 ops/s 85 758 ns
Python Win64 (JSON) 324 bytes 48 859 ops/s 20 467 ns
Ruby Win64 252 bytes 24 351 ops/s 41 066 ns
Ruby Win64 (Final) 152 bytes 33 555 ops/s 29 802 ns
Ruby Win64 (JSON) 353 bytes 42 860 ops/s 23 331 ns
Swift macOS 252 bytes 86 288 ops/s 11 589 ns
Swift macOS (Final) 152 bytes 10 3519 ops/s 9 660 ns
Swift macOS (JSON) 353 bytes 17 077 ops/s 58 558 ns

Benchmark 3: Verify

Verify benchmark C++ code:

BENCHMARK_FIXTURE(VerifyFixture, "Verify")
{
    // Verify the account
    model.verify();
}

Verify benchmark results:

Language & Platform Message size Verify rate Verify time
C++ Win64 252 bytes 31 250 000 ops/s 32 ns
C++ Win64 (Final) 152 bytes 35 714 286 ops/s 28 ns
C# Win64 252 bytes 4 504 505 ops/s 222 ns
C# Win64 (Final) 152 bytes 8 064 516 ops/s 124 ns
Go Win64 252 bytes 8 474 576 ops/s 118 ns
Go Win64 (Final) 152 bytes 9 090 909 ops/s 110 ns
Java Win64 252 bytes 11 790 374 ops/s 85 ns
Java Win64 (Final) 152 bytes 16 205 533 ops/s 62 ns
JavaScript Win64 252 bytes 1 105 627 ops/s 905 ns
JavaScript Win64 (Final) 152 bytes 5 700 408 ops/s 175 ns
Kotlin Win64 252 bytes 8 625 935 ops/s 116 ns
Kotlin Win64 (Final) 152 bytes 13 373 757 ops/s 75 ns
Python Win64 252 bytes 20 825 ops/s 48 019 ns
Python Win64 (Final) 152 bytes 23 590 ops/s 42 391 ns
Ruby Win64 252 bytes 57 201 ops/s 17 482 ns
Ruby Win64 (Final) 152 bytes 74 262 ops/s 13 466 ns
Swift macOS 252 bytes 164 446 ops/s 6 081 ns
Swift macOS (Final) 152 bytes 228 154 ops/s 4 383 ns
Issues
  • executing fbec command(C#) with multiple .fbe files gives some missing dependency errors

    executing fbec command(C#) with multiple .fbe files gives some missing dependency errors

    Attached a simple vs project. Paragon.DoT.zip

    For example, have a look at this file:

    • Network/Messages/dot_network_messages.cs

    All files were generated using this .bat file: Run the Paragon.DoT\DoT\run-fbe.bat file and you will know what do I mean.

    See if this is possible to fix or if it is better to use one BIG .fbe FILE.

    Apart from that, would be nice to add support for subpackages using '.' in C#.

    Thank you chronoxor.

    opened by josep-calull 13
  • Question about domain declaration and offset calculation

    Question about domain declaration and offset calculation

    First of all, thank you for the wonderful library, it's working fine and does a great job! But I'd like to elaborate few things in order to get better understanding.

    First, what is the purpose of 'domain' declaration? Is it for all languages or just for some? It does not appear in the generated .h files.

    Second, how the offset is calculated? Is it in bytes or other units? Offset from what? It's not that obvious as may seem at first glance and I did not find any description of that.

    Here is the example:

    struct MyBytes
    {
      bytes data;
    }
    

    I added 9 bytes to the data: [1,9];

    Here is the corresponding hex dump of the buffer with my guess of what it means:

    21 00 00 00 08 00 00 00  // total size 33 bytes + ? offset 8 bytes from the beginning
    0C 00 00 00 02 00 00 00  // ? offset 12 bytes from the beginning + ? Type 2
    0C 00 00 00 09 00 00 00  // ???? (4 bytes) + data size 9 bytes 
    01 02 03 04 05 06 07 08  // the data
    09
    
    opened by sugurd 10
  • Swift Question: Ho do I get  the serialized Data out of the buffer?

    Swift Question: Ho do I get the serialized Data out of the buffer?

    I have generated a model Visit, I want to fast serialize and then store it in a store that accepts Swift's Data() type.

    What I have is:

    let visit = Visit(number: 10)
    let writer = VisitFinalModel()
    try! writer.serialize(value: visit)
    
    // I belive what I'm looking for is now in writer.buffer.data - but that is not accessible by default.
    let data = writer.buffer.data
    
    // I would now store data on disk. 
    
    // this is how i would recreate the struct
    let buf = Buffer()
    buf.attach(buffer: data)
            
    let reader = VisitModel()
    reader.attach(buffer: buf)
    let restoredModel = reader.deserialize()
    

    Question: What's the official way to get something Data() compatible from the writer.

    Thanx for this great library!

    opened by thieso2 7
  • Cannot build domain models on ubuntu

    Cannot build domain models on ubuntu

    OS: Ubuntu 20.04 FBEC: 1.4.0.0

    Im trying to build the sample domain model with the command:

    ./fbec --cpp --input=proto.fbe --output=out/.
    

    however this gives me:

    Open input file - proto.fbe...Done!
    
    proto.fbe:5: error: syntax error
    domain
         ^--- syntax error
    Parsing input...Done!
    Close input file...Done!
    Segmentation fault (core dumped)
    

    I cant find a solution to this

    opened by OptoCloud 5
  • Can't install on Solus, LIBVLD issue?

    Can't install on Solus, LIBVLD issue?

    [email protected] ~/Documents/Installed/Make/FastBinaryEncoding $ cd ../
    [email protected] ~/Documents/Installed/Make $ git clone https://github.com/chronoxor/FastBinaryEncoding.git
    Cloning into 'FastBinaryEncoding'...
    remote: Enumerating objects: 450, done.
    remote: Counting objects: 100% (450/450), done.
    remote: Compressing objects: 100% (255/255), done.
    remote: Total 33660 (delta 321), reused 217 (delta 191), pack-reused 33210
    Receiving objects: 100% (33660/33660), 125.52 MiB | 4.88 MiB/s, done.
    Resolving deltas: 100% (29368/29368), done.
    [email protected] ~/Documents/Installed/Make $ cd FastBinaryEncoding/
    [email protected] ~/Documents/Installed/Make/FastBinaryEncoding $ gil update
    Working path: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding
    Discover git links: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/.gitlinks
    Running git clone https://github.com/catchorg/Catch2.git branch "master" into /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/Catch2
    Cloning into '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/Catch2'...
    remote: Enumerating objects: 122, done.
    remote: Counting objects: 100% (122/122), done.
    remote: Compressing objects: 100% (85/85), done.
    remote: Total 26063 (delta 54), reused 77 (delta 37), pack-reused 25941
    Receiving objects: 100% (26063/26063), 15.92 MiB | 3.73 MiB/s, done.
    Resolving deltas: 100% (18143/18143), done.
    Running git clone https://github.com/weisslj/cpp-optparse.git branch "master" into /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/cpp-optparse
    Cloning into '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/cpp-optparse'...
    remote: Enumerating objects: 343, done.
    remote: Total 343 (delta 0), reused 0 (delta 0), pack-reused 343
    Receiving objects: 100% (343/343), 70.62 KiB | 753.00 KiB/s, done.
    Resolving deltas: 100% (203/203), done.
    Running git clone https://github.com/chronoxor/CppBenchmark.git branch "master" into /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppBenchmark
    Cloning into '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppBenchmark'...
    remote: Enumerating objects: 445, done.
    remote: Counting objects: 100% (445/445), done.
    remote: Compressing objects: 100% (211/211), done.
    remote: Total 14519 (delta 360), reused 254 (delta 234), pack-reused 14074
    Receiving objects: 100% (14519/14519), 40.65 MiB | 14.76 MiB/s, done.
    Resolving deltas: 100% (12098/12098), done.
    Discover git links: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppBenchmark/.gitlinks
    Running git clone https://github.com/chronoxor/CppCommon.git branch "master" into /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon
    Cloning into '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon'...
    remote: Enumerating objects: 1382, done.
    remote: Counting objects: 100% (1382/1382), done.
    remote: Compressing objects: 100% (566/566), done.
    remote: Total 42646 (delta 1208), reused 854 (delta 816), pack-reused 41264
    Receiving objects: 100% (42646/42646), 59.95 MiB | 4.28 MiB/s, done.
    Resolving deltas: 100% (38617/38617), done.
    Discover git links: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon/.gitlinks
    Running git clone https://github.com/miloyip/rapidjson.git branch "master" into /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/rapidjson
    Cloning into '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/rapidjson'...
    remote: Enumerating objects: 97, done.
    remote: Counting objects: 100% (97/97), done.
    remote: Compressing objects: 100% (56/56), done.
    remote: Total 22725 (delta 68), reused 51 (delta 39), pack-reused 22628
    Receiving objects: 100% (22725/22725), 27.06 MiB | 10.84 MiB/s, done.
    Resolving deltas: 100% (17287/17287), done.
    Running git clone https://github.com/chronoxor/CppBuildScripts.git branch "master" into /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/build
    Cloning into '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/build'...
    remote: Enumerating objects: 40, done.
    remote: Counting objects: 100% (40/40), done.
    remote: Compressing objects: 100% (24/24), done.
    remote: Total 490 (delta 21), reused 31 (delta 16), pack-reused 450
    Receiving objects: 100% (490/490), 4.49 MiB | 1.02 MiB/s, done.
    Resolving deltas: 100% (260/260), done.
    Running git clone https://github.com/chronoxor/CppCMakeScripts.git branch "master" into /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/cmake
    Cloning into '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/cmake'...
    remote: Enumerating objects: 6, done.
    remote: Counting objects: 100% (6/6), done.
    remote: Compressing objects: 100% (5/5), done.
    remote: Total 409 (delta 1), reused 3 (delta 1), pack-reused 403
    Receiving objects: 100% (409/409), 51.05 KiB | 1024.00 KiB/s, done.
    Resolving deltas: 100% (247/247), done.
    Running git clone https://github.com/HdrHistogram/HdrHistogram_c.git branch "master" into /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppBenchmark/modules/HdrHistogram
    Cloning into '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppBenchmark/modules/HdrHistogram'...
    remote: Enumerating objects: 157, done.
    remote: Counting objects: 100% (157/157), done.
    remote: Compressing objects: 100% (99/99), done.
    remote: Total 4733 (delta 98), reused 103 (delta 55), pack-reused 4576
    Receiving objects: 100% (4733/4733), 2.66 MiB | 1.36 MiB/s, done.
    Resolving deltas: 100% (2684/2684), done.
    Running git clone https://github.com/madler/zlib.git branch "master" into /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppBenchmark/modules/zlib
    Cloning into '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppBenchmark/modules/zlib'...
    remote: Enumerating objects: 5144, done.
    remote: Total 5144 (delta 0), reused 0 (delta 0), pack-reused 5144
    Receiving objects: 100% (5144/5144), 3.62 MiB | 666.00 KiB/s, done.
    Resolving deltas: 100% (3613/3613), done.
    Running git clone https://github.com/fmtlib/fmt.git branch "master" into /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon/modules/fmt
    Cloning into '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon/modules/fmt'...
    remote: Enumerating objects: 15, done.
    remote: Counting objects: 100% (15/15), done.
    remote: Compressing objects: 100% (12/12), done.
    remote: Total 20381 (delta 3), reused 8 (delta 2), pack-reused 20366
    Receiving objects: 100% (20381/20381), 9.99 MiB | 10.49 MiB/s, done.
    Resolving deltas: 100% (13861/13861), done.
    Create git link: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/Catch2 -> /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppBenchmark/modules/Catch2
    Create git link: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/cpp-optparse -> /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppBenchmark/modules/cpp-optparse
    Create git link: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/build -> /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppBenchmark/build
    Create git link: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/cmake -> /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppBenchmark/cmake
    Create git link: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/Catch2 -> /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon/modules/Catch2
    Create git link: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppBenchmark -> /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon/modules/CppBenchmark
    Create git link: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/build -> /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon/build
    Create git link: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/cmake -> /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon/cmake
    [email protected] ~/Documents/Installed/Make/FastBinaryEncoding $ cd build/
    [email protected] ~/Documents/Installed/Make/FastBinaryEncoding/build $ ./unix.sh 
    -- The C compiler identification is GNU 9.3.0
    -- The CXX compiler identification is GNU 9.3.0
    -- Check for working C compiler: /usr/bin/cc
    -- Check for working C compiler: /usr/bin/cc -- works
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Check for working CXX compiler: /usr/bin/c++
    -- Check for working CXX compiler: /usr/bin/c++ -- works
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    -- Found Doxygen: /usr/bin/doxygen (found version "1.8.15") found components: doxygen missing components: dot
    -- The System identification is Linux-5.5.11-151.current Linux 5.5.11-151.current Platform/Linux
    -- Found BISON: /usr/bin/bison (found version "3.5.3") 
    -- Found FLEX: /usr/bin/flex (found version "2.6.4") 
    -- Looking for pthread.h
    -- Looking for pthread.h - found
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
    -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
    -- Looking for pthread_create in pthreads
    -- Looking for pthread_create in pthreads - not found
    -- Looking for pthread_create in pthread
    -- Looking for pthread_create in pthread - found
    -- Found Threads: TRUE  
    -- The System identification is Linux-5.5.11-151.current Linux 5.5.11-151.current Platform/Linux
    -- Looking for sys/types.h
    -- Looking for sys/types.h - found
    -- Looking for stdint.h
    -- Looking for stdint.h - found
    -- Looking for stddef.h
    -- Looking for stddef.h - found
    -- Check size of off64_t
    -- Check size of off64_t - done
    -- Looking for fseeko
    -- Looking for fseeko - found
    -- Looking for unistd.h
    -- Looking for unistd.h - found
    -- The System identification is Linux-5.5.11-151.current Linux 5.5.11-151.current Platform/Linux
    -- Found LIBBFD: /usr/lib/libbfd.so  
    -- Found LIBDL: /usr/lib/libdl.so  
    -- Found LIBRT: /usr/lib/librt.so  
    -- Found LIBUUID: /usr/lib/libuuid.so  
    -- Could NOT find LIBVLD (missing: LIBVLD_LIBRARY) 
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp
    make[1]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    make[2]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    make[2]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    make[2]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    Scanning dependencies of target cpp-optparse
    Scanning dependencies of target fmt
    Scanning dependencies of target zlib
    make[2]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    make[2]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    make[2]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    make[2]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    make[2]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    [  1%] Building CXX object modules/CMakeFiles/cpp-optparse.dir/cpp-optparse/OptionParser.cpp.o
    make[2]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    [  1%] Building CXX object modules/CppCommon/modules/CMakeFiles/fmt.dir/fmt/src/format.cc.o
    [  2%] Building CXX object modules/CppCommon/modules/CMakeFiles/fmt.dir/fmt/src/os.cc.o
    [  3%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/deflate.c.o
    [  3%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/crc32.c.o
    [  3%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/gzclose.c.o
    [  4%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/compress.c.o
    [  4%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/adler32.c.o
    [  5%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/gzlib.c.o
    [  5%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/gzread.c.o
    [  6%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/gzwrite.c.o
    [  6%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/infback.c.o
    [  7%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/inffast.c.o
    [  7%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/inflate.c.o
    [  8%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/inftrees.c.o
    [  8%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/trees.c.o
    [  9%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/uncompr.c.o
    [  9%] Building C object modules/CppBenchmark/modules/CMakeFiles/zlib.dir/zlib/zutil.c.o
    [ 10%] Linking C static library libzlib.a
    make[2]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    [ 10%] Built target zlib
    make[2]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    Scanning dependencies of target HdrHistogram
    make[2]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    make[2]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    [ 10%] Building C object modules/CppBenchmark/modules/CMakeFiles/HdrHistogram.dir/HdrHistogram/src/hdr_encoding.c.o
    [ 10%] Building C object modules/CppBenchmark/modules/CMakeFiles/HdrHistogram.dir/HdrHistogram/src/hdr_histogram.c.o
    [ 10%] Building C object modules/CppBenchmark/modules/CMakeFiles/HdrHistogram.dir/HdrHistogram/src/hdr_interval_recorder.c.o
    [ 11%] Building C object modules/CppBenchmark/modules/CMakeFiles/HdrHistogram.dir/HdrHistogram/src/hdr_thread.c.o
    [ 11%] Building C object modules/CppBenchmark/modules/CMakeFiles/HdrHistogram.dir/HdrHistogram/src/hdr_time.c.o
    [ 12%] Building C object modules/CppBenchmark/modules/CMakeFiles/HdrHistogram.dir/HdrHistogram/src/hdr_histogram_log.c.o
    [ 13%] Building C object modules/CppBenchmark/modules/CMakeFiles/HdrHistogram.dir/HdrHistogram/src/hdr_writer_reader_phaser.c.o
    [ 13%] Linking C static library libHdrHistogram.a
    make[2]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    [ 13%] Built target HdrHistogram
    [ 13%] Linking CXX static library libcpp-optparse.a
    make[2]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    [ 13%] Built target cpp-optparse
    make[2]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    Scanning dependencies of target cppbenchmark
    make[2]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    make[2]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    [ 13%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/benchmark.cpp.o
    [ 13%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/benchmark_pc.cpp.o
    [ 14%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/benchmark_base.cpp.o
    [ 15%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/benchmark_threads.cpp.o
    [ 16%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/context.cpp.o
    [ 17%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/barrier.cpp.o
    [ 17%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/console.cpp.o
    [ 17%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/context_pc.cpp.o
    [ 18%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/context_threads.cpp.o
    [ 18%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/environment.cpp.o
    [ 19%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/executor.cpp.o
    [ 19%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/launcher.cpp.o
    [ 20%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/launcher_console.cpp.o
    [ 20%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/phase_core.cpp.o
    [ 21%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/phase_metrics.cpp.o
    [ 21%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/phase_scope.cpp.o
    [ 22%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/reporter_console.cpp.o
    [ 22%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/reporter_csv.cpp.o
    [ 23%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/reporter_json.cpp.o
    [ 23%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/settings.cpp.o
    [ 24%] Building CXX object modules/CppBenchmark/CMakeFiles/cppbenchmark.dir/source/benchmark/system.cpp.o
    [ 24%] Linking CXX static library libfmt.a
    make[2]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    [ 24%] Built target fmt
    make[2]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    Scanning dependencies of target cppcommon
    make[2]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    make[2]: Entering directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    [ 25%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/algorithms/token_bucket.cpp.o
    [ 26%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/common/reader.cpp.o
    [ 26%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/common/uint128.cpp.o
    [ 26%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/cache/filecache.cpp.o
    [ 27%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/common/uint256.cpp.o
    [ 27%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/common/writer.cpp.o
    [ 28%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/errors/exceptions.cpp.o
    [ 28%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/errors/exceptions_handler.cpp.o
    [ 29%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/errors/fatal.cpp.o
    [ 29%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/errors/system_error.cpp.o
    [ 30%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/filesystem/directory.cpp.o
    [ 30%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/filesystem/directory_iterator.cpp.o
    [ 31%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/filesystem/exceptions.cpp.o
    [ 31%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/filesystem/file.cpp.o
    [ 32%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/filesystem/path.cpp.o
    [ 32%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/filesystem/symlink.cpp.o
    [ 33%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/math/math.cpp.o
    [ 33%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/memory/memory.cpp.o
    [ 33%] Linking CXX static library libcppbenchmark.a
    make[2]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    [ 33%] Built target cppbenchmark
    [ 34%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/string/encoding.cpp.o
    [ 34%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/string/string_utils.cpp.o
    [ 35%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/console.cpp.o
    [ 35%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/cpu.cpp.o
    [ 36%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/dll.cpp.o
    [ 36%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/environment.cpp.o
    [ 37%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/pipe.cpp.o
    [ 37%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/process.cpp.o
    [ 38%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/shared_memory.cpp.o
    [ 38%] Building CXX object modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/stack_trace.cpp.o
    In file included from /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon/source/system/stack_trace.cpp:21:
    /usr/include/bfd.h:35:2: error: #error config.h must be included before this header
       35 | #error config.h must be included before this header
          |  ^~~~~
    /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon/source/system/stack_trace.cpp: In constructor ‘CppCommon::StackTrace::StackTrace(int)’:
    /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon/source/system/stack_trace.cpp:162:18: error: ‘bfd_get_section_flags’ was not declared in this scope; did you mean ‘bfd_set_section_flags’?
      162 |             if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0)
          |                  ^~~~~~~~~~~~~~~~~~~~~
          |                  bfd_set_section_flags
    /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon/source/system/stack_trace.cpp:165:27: error: ‘bfd_get_section_vma’ was not declared in this scope; did you mean ‘bfd_set_section_vma’?
      165 |             bfd_vma vma = bfd_get_section_vma(abfd, section);
          |                           ^~~~~~~~~~~~~~~~~~~
          |                           bfd_set_section_vma
    /home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/modules/CppCommon/source/system/stack_trace.cpp:169:37: error: ‘bfd_get_section_size’ was not declared in this scope; did you mean ‘bfd_set_section_size’?
      169 |             bfd_size_type secsize = bfd_get_section_size(section);
          |                                     ^~~~~~~~~~~~~~~~~~~~
          |                                     bfd_set_section_size
    make[2]: *** [modules/CppCommon/CMakeFiles/cppcommon.dir/build.make:414: modules/CppCommon/CMakeFiles/cppcommon.dir/source/system/stack_trace.cpp.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    make[2]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    make[1]: *** [CMakeFiles/Makefile2:1118: modules/CppCommon/CMakeFiles/cppcommon.dir/all] Error 2
    make[1]: Leaving directory '/home/camdenorrb/Documents/Installed/Make/FastBinaryEncoding/temp'
    make: *** [Makefile:141: all] Error 2
    

    Not really sure what to do from here :/

    opened by camdenorrb 5
  • fbec should error-out on typo

    fbec should error-out on typo

    Typo in domain model, eg:

    struct MyStruct {
        unt64 ShouldBoom;
    }
    

    Note unt64 instead of uint64. fbec happily produces:

    // MyStruct struct
    type MyStruct struct {
        ShouldBoom Unt64 `json:"ShouldBoom"`
    }
    
    opened by ghost 4
  • Some bug in receiver when parsing final model

    Some bug in receiver when parsing final model

    Hello. Minimal size of final model struct is 8 bytes, but this assert is checking that message_size is larger than 16 bytes https://github.com/chronoxor/FastBinaryEncoding/blob/393e6ee2528b9b53da8b0dc28d347ebb7cd5cd13/source/generator_cpp.cpp#L4513 Is this kind of bug or I am just using wrong compilation options?

    opened by misha1sh 4
  • Broken build on Linux

    Broken build on Linux

    ./unix.sh script tryes to commit something to github after build?

    finalizing index lists...
    writing tag file...
    lookup cache used 2123/65536 hits=54224 misses=2163
    finished...
    Built target doxygen
    On branch gh-pages
    Your branch is ahead of 'origin/gh-pages' by 1 commit.
      (use "git push" to publish your local commits)
    
    nothing to commit, working tree clean
    Password for 'https://github.com': 
    remote: Anonymous access to chronoxor/FastBinaryEncoding.git denied.
    fatal: Authentication failed for 'https://@github.com/chronoxor/FastBinaryEncoding.git/'
    
    opened by DrTon 4
  • Build failed on Mac OS

    Build failed on Mac OS

    • Darwin-16.7.0
    • AppleClang 9.0.0.9000039
    In file included from /Users/ton/Developer/FastBinaryEncoding/tests/test_clone.cpp:7:
    In file included from /Users/ton/Developer/FastBinaryEncoding/tests/../proto/proto.h:16:
    /Users/ton/Developer/FastBinaryEncoding/tests/../proto/fbe.h:27:10: fatal error: 'optional' file
          not found
    #include <optional>
             ^~~~~~~~~~
    
    opened by DrTon 3
  • "fbe.h" windows header file problem hope to modify

    To resolve the conflict between WinSock2.h and windows.h

    update FastBinaryEncoding\source\generator_cpp.cpp

    change: line 196

    #elif defined(_WIN32) || defined(_WIN64)
    #include <windows.h>
    #undef DELETE
    #undef ERROR
    #undef HOST_NOT_FOUND
    #undef Yield
    #undef min
    #undef max
    #undef uuid_t
    #endif
    

    to:

    #elif defined(_WIN32) || defined(_WIN64)
    //#include <windows.h>
    #undef DELETE
    #undef ERROR
    #undef HOST_NOT_FOUND
    #undef Yield
    #undef min
    #undef max
    #undef uuid_t
    #endif
    

    inser line 6334:

        // Generate win
        WriteLine();
        WriteLineIndent("#if defined(_WIN32) || defined(_WIN64)");
        WriteLineIndent("#include <windows.h>");
        WriteLineIndent("#undef uuid_t");
        WriteLineIndent("#endif");
    

    std::max -> (std::max)

    opened by coretimes 2
  • Versioning with Struct inheritance?

    Versioning with Struct inheritance?

    Is it supported to extend a struct that one inherits from? Also in multiple levels?

    Its not clear from the documentation as versioning is only done on "simple" structs.

    opened by hassila 2
  • Docs update? Default C# interface implementations requires C# 8.

    Docs update? Default C# interface implementations requires C# 8.

    Just to mention small thing: Default interface implementations requires C# 8. Feel free if you want to add it to the docs. FBE will make things so easy by 10x. Thank you.

    opened by josep-calull 0
  • Javascript Client Request Issue

    Javascript Client Request Issue

    Looks like the client _requests_by_id and _requests_by_timestamp are Map objects and should use set/get. Also, the timeout passed to the request method is multiplied by 1000000. I would think since the timestamp is milliseconds and the timeout is milliseconds that no conversion would be needed. Once I modified the Map objects to use set/get and removed the timeout multiplier, the client request seemed to work as expected. Thanks.

    opened by jbspears 2
  • Bump follow-redirects from 1.14.6 to 1.14.9 in /projects/JavaScript

    Bump follow-redirects from 1.14.6 to 1.14.9 in /projects/JavaScript

    Bumps follow-redirects from 1.14.6 to 1.14.9.

    Commits
    • 13136e9 Release version 1.14.9 of the npm package.
    • 2ec9b0b Keep headers when upgrading from HTTP to HTTPS.
    • 5fc74dd Reduce nesting.
    • 3d81dc3 Release version 1.14.8 of the npm package.
    • 62e546a Drop confidential headers across schemes.
    • 2ede36d Release version 1.14.7 of the npm package.
    • 8b347cb Drop Cookie header across domains.
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump vm2 from 3.9.5 to 3.9.7 in /projects/JavaScript

    Bump vm2 from 3.9.5 to 3.9.7 in /projects/JavaScript

    Bumps vm2 from 3.9.5 to 3.9.7.

    Release notes

    Sourced from vm2's releases.

    3.9.7

    Fixes

    b7f794dfb3034d2173b9da957f48425adc4081c3: Custom Resolver is allowed to return undefined 568934f58cf72339a3dd2a2c578cc28550c19d27: Fixed some bugs introduced in v3.9.6 b6581b4a9cf9a4706b2967fceb5930a3de4d2ac7: Fixed root path checking

    3.9.6

    Fixes

    532120d5cdec7da8225fc6242e154ebabc63fe4d: Internal restructuring and security improvements

    Changelog

    Sourced from vm2's changelog.

    v3.9.7 (2022-02-10)

    [fix] Allow relative require from base script
    [fix] Fix issue with modules with exports clause in package json
    [fix] Added missing whitelist check before custom require
    [fix] Revert plain object toString behavior
    [fix] Root path check improved

    v3.9.6 (2022-02-08)

    [fix] Security fixes (XmiliaH)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump engine.io from 6.1.0 to 6.1.2 in /projects/JavaScript

    Bump engine.io from 6.1.0 to 6.1.2 in /projects/JavaScript

    Bumps engine.io from 6.1.0 to 6.1.2.

    Release notes

    Sourced from engine.io's releases.

    6.1.2

    Bug Fixes

    • uws: expose additional uWebSockets.js options (#634) (49bb7cf)
    • uws: fix HTTP long-polling with CORS (45112a3)
    • uws: handle invalid websocket upgrades (8b4d6a8)

    Links

    6.1.1

    :warning: This release contains an important security fix :warning:

    A malicious client could send a specially crafted HTTP request, triggering an uncaught exception and killing the Node.js process:

    RangeError: Invalid WebSocket frame: RSV2 and RSV3 must be clear at Receiver.getInfo (/.../node_modules/ws/lib/receiver.js:176:14) at Receiver.startLoop (/.../node_modules/ws/lib/receiver.js:136:22) at Receiver._write (/.../node_modules/ws/lib/receiver.js:83:10) at writeOrBuffer (internal/streams/writable.js:358:12)

    This bug was introduced by this commit, included in [email protected], so previous releases are not impacted.

    Thanks to Marcus Wejderot from Mevisio for the responsible disclosure.

    Bug Fixes

    • properly handle invalid data sent by a malicious websocket client (c0e194d)

    Links

    Changelog

    Sourced from engine.io's changelog.

    6.1.2 (2022-01-18)

    Bug Fixes

    • uws: expose additional uWebSockets.js options (#634) (49bb7cf)
    • uws: fix HTTP long-polling with CORS (45112a3)
    • uws: handle invalid websocket upgrades (8b4d6a8)

    6.1.1 (2022-01-11)

    :warning: This release contains an important security fix :warning:

    A malicious client could send a specially crafted HTTP request, triggering an uncaught exception and killing the Node.js process:

    RangeError: Invalid WebSocket frame: RSV2 and RSV3 must be clear at Receiver.getInfo (/.../node_modules/ws/lib/receiver.js:176:14) at Receiver.startLoop (/.../node_modules/ws/lib/receiver.js:136:22) at Receiver._write (/.../node_modules/ws/lib/receiver.js:83:10) at writeOrBuffer (internal/streams/writable.js:358:12)

    This bug was introduced by this commit, included in [email protected], so previous releases are not impacted.

    Thanks to Marcus Wejderot from Mevisio for the responsible disclosure.

    Bug Fixes

    • properly handle invalid data sent by a malicious websocket client (c0e194d)
    Commits
    • 90fb0a9 chore(release): 6.1.2
    • e122e4b refactor: add additional types
    • 3f1e312 chore: bump package-lock.json file version
    • 45112a3 fix(uws): fix HTTP long-polling with CORS
    • 49bb7cf fix(uws): expose additional uWebSockets.js options (#634)
    • 8b4d6a8 fix(uws): handle invalid websocket upgrades
    • a84595a chore(deps): bump engine.io from 4.0.0 to 4.1.2 in /examples/latency (#636)
    • f3b761d chore(release): 6.1.1
    • c0e194d fix: properly handle invalid data sent by a malicious websocket client
    • b04967b refactor: import Node's setTimeout & clearTimeout to prevent ambiguity (#632)
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(1.10.0.0)
Owner
Ivan Shynkarenka
Cross-platform C++, highload servers, low latency, trading platforms, exchanges, crytpo markets, communication protocols, TCP, UDP, WebSockets, FIX, MT4, MT5.
Ivan Shynkarenka
universal serialization engine

A Universal Serialization Engine Based on compile-time Reflection iguana is a modern, universal and easy-to-use serialization engine developed in c++1

qicosmos 619 Jun 20, 2022
Zmeya is a header-only C++11 binary serialization library designed for games and performance-critical applications

Zmeya Zmeya is a header-only C++11 binary serialization library designed for games and performance-critical applications. Zmeya is not even a serializ

Sergey Makeev 94 Jun 6, 2022
Simple Binary Encoding (SBE) - High Performance Message Codec

Simple Binary Encoding (SBE) SBE is an OSI layer 6 presentation for encoding and decoding binary application messages for low-latency financial applic

Real Logic 2.7k Jun 22, 2022
Your binary serialization library

Bitsery Header only C++ binary serialization library. It is designed around the networking requirements for real-time data delivery, especially for ga

Mindaugas Vinkelis 713 Jun 24, 2022
Binary Serialization

Binn Binn is a binary data serialization format designed to be compact, fast and easy to use. Performance The elements are stored with their sizes to

null 358 Jun 20, 2022
C++17 library for all your binary de-/serialization needs

blobify blobify is a header-only C++17 library to handle binary de-/serialization in your project. Given a user-defined C++ struct, blobify can encode

Tony Wasserka 236 Jun 20, 2022
Experimental mutation testing tool for Swift and XCTest powered by mull

mull-xctest Experimental mutation testing tool for Swift and XCTest powered by mull. ⚠️ This tool is still experimental and under development. Install

Yuta Saito 43 Mar 3, 2022
A C++11 ASN.1 BER Encoding and Decoding Library

fast_ber A performant ASN.1 BER encoding and decoding library written in C++11 Introduction fast_ber is a small, lightweight library for BER encoding

null 69 May 22, 2022
Microsoft 2.4k Jun 27, 2022
Cap'n Proto serialization/RPC system - core tools and C++ library

Cap'n Proto is an insanely fast data interchange format and capability-based RPC system. Think JSON, except binary. Or think Protocol Buffers, except

Cap'n Proto 9k Jun 23, 2022
Consistent Hashing Using Fibonacci Encoding

fibonacci_table This does not work as I thought it would. I did not manage to compute an inverse fibonacci mapping. It works, but just like linear has

Wolfgang Brehm 10 Jan 30, 2021
Base64 Encoding implementation in C Programming Language

cb64 Base64 Encoding implementation in C Programming Language Spec: https://datatracker.ietf.org/doc/html/rfc4648#page-5 Header only So just copy cb64

Telkom DEV 1 Dec 14, 2021
Like my previous encoding project but actually likely finishedable. Also in C++.

EncodedCPP Like my previous encoding project but actually likely finishedable. Also in C++. Now with encoding and decoding options. Saving codes has a

null 1 Jan 1, 2022
RLE-encoding/decoding for files in C

RLE-encoding RLE-encoding/decoding for files in C My version of file encoding/decoding as an assignment for Metropolia UAS in C-programming course . T

Vasily Davydov 2 Nov 12, 2021
A C++11 library for serialization

cereal - A C++11 library for serialization cereal is a header-only C++11 serialization library. cereal takes arbitrary data types and reversibly turns

iLab @ USC 3.2k Jun 23, 2022
FlatBuffers: Memory Efficient Serialization Library

FlatBuffers FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serializ

Google 18.1k Jun 20, 2022
Yet Another Serialization

YAS Yet Another Serialization - YAS is created as a replacement of boost.serialization because of its insufficient speed of serialization (benchmark 1

niXman 546 Jun 20, 2022
An implementation of the MessagePack serialization format in C / msgpack.org[C]

CMP CMP is a C implementation of the MessagePack serialization format. It currently implements version 5 of the MessagePack Spec. CMP's goal is to be

Charlie Gunyon 280 Jun 21, 2022
MPack - A C encoder/decoder for the MessagePack serialization format / msgpack.org[C]

Introduction MPack is a C implementation of an encoder and decoder for the MessagePack serialization format. It is: Simple and easy to use Secure agai

Nicholas Fraser 359 May 24, 2022