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

Prototype lazy type graphs #153

Closed
warriordog opened this issue Nov 28, 2023 · 1 comment
Closed

Prototype lazy type graphs #153

warriordog opened this issue Nov 28, 2023 · 1 comment
Assignees
Labels
area:code Affects or applies to the library code type:research Research or design project, not direct work

Comments

@warriordog
Copy link
Owner

warriordog commented Nov 28, 2023

This is an idea for an improvement + optimization for the type graph system. It introduces some complexity, but has some key benefits:

  1. This finally clears the way to Allow AS types to not have an entity #134.
  2. Performance improvement - we only convert entities that are actually used.
  3. Removes dependency on ASTypeInfoCache

There may also be an opportunity to reduce the use of pivots by developing an EntityFactory or similar. That could be injected into TypeGraphReader and used to construct the appropriate entity types in a more-efficient way.

Proposed design (WIP):

  • Create new internal class TypeGraphReader:
    • Contains all the entity conversion logic from TypeMapConverter.
    • Works on JsonElement directly.
  • Create new internal class JsonTypeMap (name TBD):
    • Requires a JsonElement and the TypeGraphReader.
    • Expose functions to read entities, types, context, and metdata.
  • Update TypeMap:
    • Add internal constructor that accepts and wraps a JsonTypeMap.
    • "get" methods Fall back on JsonTypeMap if available.
  • Update TypeMapConverter:
    • Construct a singleton TypeGraphReader.
    • Remove entity conversion and construct a JsonTypeMap instead.
@warriordog warriordog added area:code Affects or applies to the library code type:research Research or design project, not direct work labels Nov 28, 2023
@warriordog warriordog self-assigned this Nov 28, 2023
@warriordog
Copy link
Owner Author

Updated design to account for ASP.NET Core - Dependency Injection is not available in middleware. TypeMapConverter must have a no-args constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:code Affects or applies to the library code type:research Research or design project, not direct work
Projects
None yet
Development

No branches or pull requests

1 participant