-
-
Notifications
You must be signed in to change notification settings - Fork 459
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
WIP: Visitor pattern implementation for serialization #1456
base: master
Are you sure you want to change the base?
WIP: Visitor pattern implementation for serialization #1456
Conversation
…through a few remaining tests
I like the idea of a visitor that understands the reflection data and provides a simpler user-facing API. The current reflection API is complex, and is also not documented very well. However, I think such a visitor API would be a better fit for C++ as there the compiler is able to optimize out virtual calls if it knows the type of the visitor. In C having this many callbacks hurts performance since they can't be inlined. Both the JSON serializer and flecs script are performance critical, so I don't think this PR is moving things in the right direction. Some thoughts on improving the usability of the reflection API:
|
Reworks/merges the JSON/Script serialization functions to use a single entity-component "graph" traversal mechanism. This mechanism can also be used by user code in order to perform arbitrary serializations, and/or as a map/reduce mechanism.