Skip to content

Metadata decoding complex and leaks memory #2431

Closed

Description

@jeromekelleher

As observed in #2428, and directly here:

#2428 (comment)_

Activity

  1. added a commit that references this issue on Jul 22, 2022
    8c352a4
  2. jeromekelleher commented on Jul 22, 2022

    @jeromekelleher
    MemberAuthor

    In #2432 I've made a pass at solving this by making metadata decoding fully "eager", (instead of lazy). Specifically, this decodes the metadata when an object (row or entity) is created, rather than when the .metadata attribute is accessed. This works and does simplify the code a lot, but it may be a step too far in terms of changing the current behaviour.

    I've had another go at tweaking things, but there's a complicated web of semi-conflicting requirements that it's very hard to disentangle. We're treating XTableRow and the entity X classes in the same way as dataclasses. These have both the metadata attribute, but that's somehow accessed dynamically behind the scenes. Some of the dataclasses are specified as frozen, and some aren't.

    Any thoughts here @benjeffery? Can we simplify the design a bit here, or should we just try to get to the bottom of the circular references problem in #2428?

  3. changed the title [-]Metadata decoding overly complex and leaks memory[/-] [+]Metadata decoding complex and leaks memory[/+] on Jul 22, 2022
  4. jeromekelleher commented on Jul 25, 2022

    @jeromekelleher
    MemberAuthor

    Decoding leak fixed in #2439

    We should still probably discuss the possibility of simplifying things a bit.

  5. benjeffery commented on Jul 28, 2022

    @benjeffery
    Member

    I think with #2441 and #2439 I think we can close this? The metadata decoding is still complex due to needing the decoding to be lazy in a dataclass, but there the perf tradeoff is more than worth it.

  6. jeromekelleher commented on Jul 29, 2022

    @jeromekelleher
    MemberAuthor

    Yeah, agreed. Be nice to get some data on the perf tradeoffs here, but lets close.

  7. benjeffery commented on Jul 29, 2022

    @benjeffery
    Member

    Yeah, agreed. Be nice to get some data on the perf tradeoffs here, but lets close.

    We'll get this in #2444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions