Skip to content

dpack data much bigger than json data #2

Description

@derMart

Hi,

I am searching for a compact representation of javascript objects. It seems dpack is actually much larger than json for my use case. My data consists of one object which contains a lot of arrays and small objects with loads of Number primitives.
e.g.

[ [1, 2, 3, 4, { prop1: 5, prop2: 6}], [7, 8, 9, 10, { prop1: 11, prop2: 12}] ... ]

except that these numbers are not integers but doubles, so each number in json is around 16 to 18 bytes.
It turns out, however, if i look at the generated dpack data, that each of those numbers is still stored as ASCII using also 16 to 18 bytes each. The outcome is that a 1.9MB json test file is 3.7MB stored as dpack.
I would assume that a Number should be represented as 8 bytes max (or preferably 4 bytes if one would have an option to reduce doubles to floats).
Confusing is also that apart from storing Numbers similarly as json the dpack data is much larger than the json data.
What is going on here, is this a bug?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions