opendesigndev / octopus-specs

Octopus format specification (OpenAPI)
https://main.d215pdpdn4c7ow.amplifyapp.com/
2 stars 3 forks source link

Octopus 3 compression techniques. #19

Open scoiatael opened 1 year ago

scoiatael commented 1 year ago

In GitLab by @nikitamironov on Jan 14, 2020, 11:03

Problem

Octopus can represent large amount of data. We can try to compress it in different ways.

Possible solutions

There are different ways to achieve the goal.

Binary format

There are a lot of different binary formats we can use, such as protobuf, flatbuffers, bson...
Pros:

Cons:

Cons:

JSON with more compact data representation

In previous versions of Octopus we didnt care much about size. As a consequence we have quite big result JSON file with different kinds of data. Optimizations can help us save some bytes by restructuring some data, renaming its properties and other ways.
Important thing we can not forget about is readability of file. Of course its possible to write only and only data without any descriptive keys and structures, but it will be pain to work with such data files.
We can use the following techniques, its topic to discuss:

scoiatael commented 1 year ago

In GitLab by @nikitamironov on Jan 14, 2020, 11:05

Personally I'd choose JSON with compact representation. I still think about linkings, it will really reduce size of file but its quite sensitive thing, I am not sure we are 100% ready for it. Smaller key names and removed redundant keys are must-have.

scoiatael commented 1 year ago

In GitLab by @janroztocil on Jan 14, 2020, 13:28

In general, I'm not against a reduction of Octopus byte size, however, I'd prefer to address it as an additional step once the new model and its working implementation are ready. The main reasons for JSON format are readability for us and for the third parties, low complexity and no necessity for external dependencies. Also, this will establish a baseline we can later use to benchmark an eventual optimization.

This considered Octopus as a whole, we might, however, apply local optimization where it makes sense, namely to the shape geometry representation. There was a proposal for having atomic paths encoded using SVG Path notation, this seems like a good idea, it's compact and yet universally understood format.

Regarding the offloading of shape geometry into assets, I'm not particularly keen on that. The complexity of that this feature is not imo justified enough.

And on shortening the keys... eh, why not, it won't do any noticeable difference, but there's no reason for having them unnecessarily long.