Skip to content

Cache properties that never change #365

Closed

Description

@dwalton76

Activity

  1. WasabiFan commented on Sep 20, 2017

    @WasabiFan
    Member

    I recall discussing this in detail previously... Did we really never implement it? Was there a PR somewhere which was closed? Or did we decide to cut it and save the related decisions for later?

  2. dwalton76 commented on Sep 20, 2017

    @dwalton76
    CollaboratorAuthor

    Not that I remember but it may have been before my time

  3. WasabiFan commented on Sep 20, 2017

    @WasabiFan
    Member

    I could've sworn I was discussing it on a PR with @ddemidov within the last month or two... I can't remember if it was part of said PR and we removed it, or if we were just including snippets in comments.

  4. ddemidov commented on Sep 21, 2017

    @ddemidov
    Member

    I could've sworn I was discussing it on a PR with @ddemidov within the last month or two...

    This does not sound like anything to me :).

    But caching the attributes on motor construction makes sense.

  5. WasabiFan commented on Sep 21, 2017

    @WasabiFan
    Member

    Am I going crazy? I'm convinced we discussed this recently. We had a cache object, and if the property value existed in the cache it was used otherwise it was added to the cache... And we ran into some sort of decision to be made but didn't want to block the larger PR so we removed it.

    Maybe I am insane.

  6. ddemidov commented on Sep 21, 2017

    @ddemidov
    Member

    May be I am just forgetting things :). Now that you mentioned it, I do remember some discussion involving python dictionaries, but I still can not remember when/where was that.

  7. ddemidov commented on Sep 21, 2017

    @ddemidov
    Member
  8. WasabiFan commented on Sep 21, 2017

    @WasabiFan
    Member

    Ooh, that looks like it! I guess we implemented a specialized version of this but not the generic solution.

  9. kortschak commented on Sep 29, 2017

    @kortschak
    Member

    I'm considering the design for ev3go now and I'd like input from you all. The approach that I'm leaning towards capturing all the invariant attributes on opening the device (I'll add struct fields to the device types). This differs from the approach above in that there is an upfront cost to getting the values, but it means that I can make the methods to return the values later non-errorable. It also simplifies the handling of memoisation in that I don't need to retain and validity state marker.

    Opinions?

  10. WasabiFan commented on Sep 29, 2017

    @WasabiFan
    Member

    The fact that errors are entirely avoided by your approach is interesting; aside from that, I see very little reason to go one way or the other. And honestly, I don't think there's a significant difference from a speed perspective either, because the read operations are extremely quick when considered relative to all the other things happening in one of these apps. Overall, it seems reasonable to me.

  11. self-assigned this
    on Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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