Memory optimization of static_variant #21

Closed
opened 2020-08-06 23:20:49 +00:00 by pblockc · 2 comments
pblockc commented 2020-08-06 23:20:49 +00:00 (Migrated from gitlab.com)

Peerplays operation is typedef of static_variant. As blockchain operations are used everywhere in the database it would be great to reduce the memory footprint of this structure as much as possible.

static_variant contains member variable storage that is a static array of characters which size is deduced from the largest type of a variant. This means every operation in the database is as large as the largest type + 8 bytes for _tag + some bytes for memory alignment.

Changing from static_variant to raw_array would greatly reduce the memory as some operations(like asset-create operation) size is high.

Ref:https://github.com/bitshares/bitshares-fc/pull/85

Estimate: 16 hours including unit testing with replays

Peerplays operation is typedef of static_variant. As blockchain operations are used everywhere in the database it would be great to reduce the memory footprint of this structure as much as possible. static_variant contains member variable storage that is a static array of characters which size is deduced from the largest type of a variant. This means every operation in the database is as large as the largest type + 8 bytes for _tag + some bytes for memory alignment. Changing from static_variant to raw_array would greatly reduce the memory as some operations(like asset-create operation) size is high. Ref:https://github.com/bitshares/bitshares-fc/pull/85 Estimate: 16 hours including unit testing with replays
pblockc commented 2020-10-16 15:30:03 +00:00 (Migrated from gitlab.com)

mentioned in merge request PBSA/PeerplaysIO/tools-libs/peerplays-fc!19

mentioned in merge request PBSA/PeerplaysIO/tools-libs/peerplays-fc!19
pblockc commented 2020-10-16 15:30:45 +00:00 (Migrated from gitlab.com)

Job has been finished and merge request is created:
https://gitlab.com/PBSA/PeerplaysIO/tools-libs/peerplays-fc/-/merge_requests/19

Job has been finished and merge request is created: https://gitlab.com/PBSA/PeerplaysIO/tools-libs/peerplays-fc/-/merge_requests/19
bobinson (Migrated from gitlab.com) closed this issue 2020-11-02 11:56:35 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#21
No description provided.