Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storage format: custom vs kotlinx serialization #8

Open
1 task
d-r-q opened this issue Oct 23, 2019 · 2 comments
Open
1 task

Storage format: custom vs kotlinx serialization #8

d-r-q opened this issue Oct 23, 2019 · 2 comments
Labels
enhancement js Issues specific to Kotlin/JS multiplatform Issues related to multiplatform support tests
Milestone

Comments

@d-r-q
Copy link
Owner

d-r-q commented Oct 23, 2019

Actual behavior: Eavs are serialized to trx log via custom serialization.

Quality for this serialization is unclear and it's more difficult to implement support of nested map attributes using custom serialization.

Consider switch to kotlinx.serialization/CBOR.

  • Restore serialization test

Comparison matrix:

custom kotlinx
Dependencies None On stdlib
Multiplatform Yes Yes
Performance ??? Probably more performant
Memory footprint ??? Probably more effective
Support of Maps Hard Build-in
Requrements for stored data No Probably will require some changes in qbit data structures

kotlinx advantages:

@d-r-q d-r-q added enhancement choose Issues, where there are several alternatives to consider and choose labels Oct 23, 2019
@d-r-q d-r-q added this to the Backlog milestone Oct 30, 2019
@d-r-q
Copy link
Owner Author

d-r-q commented May 30, 2020

There are some strange behavior of numbers on js - objects that at compile time has type Byte, at run time are Int. And due to this "feature" custom serialization doesn't. I suggest, that there're more such issues, so decide to migrate to kotlinx serialization and move this issue to mpp project

@d-r-q d-r-q added js Issues specific to Kotlin/JS multiplatform Issues related to multiplatform support tests and removed choose Issues, where there are several alternatives to consider and choose labels May 30, 2020
@d-r-q d-r-q modified the milestones: Backlog, Multiplatform May 30, 2020
@d-r-q
Copy link
Owner Author

d-r-q commented May 31, 2020

Look like there is no magic, and Kotlin serialization also cannot handle the problem. The problem is that in Eav have no meta information about value type and there is no sound way to determine value type by value itself. To mitigate the problem type meta information should be introduced in Eav someway, but Eavs, are actually used almost everywhere, so I decided to postpone the change to clean up stage, to ensure, that new version for sure works for multiplatform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement js Issues specific to Kotlin/JS multiplatform Issues related to multiplatform support tests
Projects
None yet
Development

No branches or pull requests

1 participant