Open xeolabs opened 2 years ago
An idea - factor strings out into a lookup table within the metadata JSON.
In the snippet below, the integer values for those properties are indexes into the string dictionary. We could also treat the property names in the same way.
{
"dictionary": [
"IfcWindow",
"IfcDoor",
"1E1QVUnGb7UwbYyT0lPilv",
"Window",
"1E1QVUnGb7UwbYyT0lPilv",
"1E1QVUnGb7UwbYyT0lPilv",
"Door"
],
"metaObjects": [
{
"id": 2,
"name": 3,
"type": 0
},
{
"id": 4,
"name": 6,
"type": 1,
"parent": 2
}
]
}
We do something like the second option at BIMData. It is fast and the complexity of rebuilding usable data from the JSON isn't high.
There are many repeated strings in the metadata JSON. Perhaps compress using: https://coderwall.com/p/mekopw/jsonc-compress-your-json-data-up-to-80