Sha256: 20b413982e076dfdcb2c39a79b219558db60e97773a9202ab42f15bc303a5757

Contents?: true

Size: 660 Bytes

Versions: 6

Compression:

Stored size: 660 Bytes

Contents

#include <msgpack.h>

void test()
{
    size_t size = 10000000;
    msgpack_sbuffer buf;
    msgpack_packer * pk;
    size_t upk_pos = 0;
    msgpack_unpacked msg;

    msgpack_sbuffer_init(&buf);

    pk = msgpack_packer_new(&buf, msgpack_sbuffer_write);

    msgpack_pack_array(pk, size);
    {
        size_t idx = 0;
        for (; idx < size; ++idx)
            msgpack_pack_uint32(pk, 1);
    }
    msgpack_packer_free(pk);

    msgpack_unpacked_init(&msg);

    while (msgpack_unpack_next(&msg, buf.data, buf.size, &upk_pos)) {
    }

    msgpack_sbuffer_destroy(&buf);
}

int main(void)
{
    int i = 0;
    for (; i < 10; ++i) test();
    return 0;
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
script_core-0.0.6 ext/enterprise_script_service/msgpack/example/c/speed_test_uint32_array.c
script_core-0.0.5 ext/enterprise_script_service/msgpack/example/c/speed_test_uint32_array.c
script_core-0.0.4 ext/enterprise_script_service/msgpack/example/c/speed_test_uint32_array.c
script_core-0.0.3 ext/enterprise_script_service/msgpack/example/c/speed_test_uint32_array.c
script_core-0.0.2 ext/enterprise_script_service/msgpack/example/c/speed_test_uint32_array.c
script_core-0.0.1 ext/enterprise_script_service/msgpack/example/c/speed_test_uint32_array.c