BHoM / BHoM/Grasshopper_UI

Grasshopper_Toolkit: Change storing of internalised data to be stored as byte[] rather than Json

Open
#625 0 comments 0 reactions 1 assignee Claimed by @adecler View on GitHub
type:feature
Dominant language
C#
Stars
18
Forks
5
PR merge metrics
No merged PRs in 30d

Description

#### Description:

Grasshopper reader/writer supports `byte[]`. We are already suing the mechanism of going from Bson to `byte[]` and back in the socket toolkit.

Idea would be to check if there is any benefit in doing the same while storing internalised data in Grasshopper.

This is changing the methods in here:

https://github.com/BHoM/Grasshopper_Toolkit/blob/9085584374c45c3b9a275a2c0959c74477c7bc0d/Grasshopper_UI/Goos/GH_BakeableObject.cs#L140-L171

To instead of writing the Json to string, instead convert to BSON then to `byte[]` and store that. Also then need to add support for reading this back, keeping the old reader as well to support older documents.

The benefit I can see of this would be two things (hopefully), if non of them are true, this idea can be scrapped:
1. Speed. Time to save and open documents with vast amounts of serialised data. Keeping everything binary feels like it should be meaning a performance boost.
2. File size. Not sure if this is actually the case, but if it would reduce the file size it would be beneficial, especially as the file size matters quite a bit for the autosave function to not stop your work from running smoothly in definitions with serialised data in them.

This is ofc not a critical issue, as functionality wise it will be the same, just a matter of a potential speed upgrade.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.