Skip to content

Desktop Performance RFC #5649

Open
Open

Description

@iAmWillShepherd

Goal

The goal of this project is to provide insights on Desktop's performance so the team can make informed product decisions and to better prioritize issues.

At the moment, much is unknown about how Desktop performs in the wild. Every now and again, we will get an issue where a user is having a bad experience with Desktop on their computer while the team has to guess what could be causing such terrible performance. This is not ideal because it increases the difficulty of determining the impact an issue has and slows the pace at which we get answers — if we get an answer at all.

What success looks like

I will consider this project a success if we are able to answer any of the questions from these five categories:

Category Questions
Workflow What do our users spend most of their time doing? Which workflow (part or full) is slowest? How long does each step in a workflow normally take?
RAM What is Desktop’s memory usage over time?
Network How much time are our users spending waiting on Desktop to complete API requests?
Errors When are users encountering errors? What are they? Is it a trend?

Where are we now?

The current format of our metrics package is unable to support the level of granularity needed to give any insight on the areas defined above, so we will have to revise how we collect and submit usage. Thomas and I spent a short amount of time discussing what a new metrics package would look like and we agreed that we should try to incorporate what’s being done in atom/telemetry.

Refined Data structure we came up with to submit metrics

[
    {
        "dimension": {
            "user_guid": "",
            "installation_guid": "",
            "event_type": "commit"
        },
        "measure": {
            "network_time": -1,
            "memory_usage": 8e+8
        }
    }
]

The key difference between this structure and the one in production is the one we are suggesting has an event granularity while the one in production is aggregated data.

What needs to get done

This list is not complete as these are the things that need to be done before we can move to bigger more interesting things like creating new Mode Looker dashboards.

  • Come up with new data structure that supports our new data needs and implement them: Update stats reporting data structure #5695
  • Determine metrics we'd like to start tracking and get them implemented in code
  • Update central to be compatible with new metrics format
  • POC using structured logging

cc, @desktop/analytics

Activity

  1. changed the title [-][DRAFT RFC] Desktop Performance[/-] [+][DRAFT] Desktop Performance RFC[/+] on Sep 14, 2018
  2. shiftkey commented on Sep 14, 2018

    @shiftkey
    Member

    Re: measuring CPU utilization - this Twitter thread has some interesting food for thought cc @NickCraver https://twitter.com/Nick_Craver/status/1038747663636877312

  3. added
    meta
    on Sep 15, 2018
  4. outofambit commented on Sep 19, 2018

    @outofambit
    Contributor

    this looks awesome. @iAmWillShepherd should i be comparing this to the data structure in laid out in https://desktop.github.com/usage-data/?

  5. iAmWillShepherd commented on Sep 19, 2018

    @iAmWillShepherd
    ContributorAuthor

    @shiftkey maybe CPU utilization is the wrong word. I was thinking more like CPU-bound work. So something like computing ahead/behind for each branch in a repo would be considered CPU bound work.

  6. iAmWillShepherd commented on Sep 19, 2018

    @iAmWillShepherd
    ContributorAuthor

    @outofambit yes, that is currently the state of our metrics. We may have to rework that structure to answer the questions we want, but what's there now should be sufficient to wrap your head around things.

  7. changed the title [-][DRAFT] Desktop Performance RFC[/-] [+]Desktop Performance RFC[/+] on Sep 20, 2018
  8. iAmWillShepherd commented on Sep 20, 2018

    @iAmWillShepherd
    ContributorAuthor

    @shiftkey, I removed the CPU category, if we decide that would be useful in the feature, we can have a discussion then on how best to capture and analyze that data.

  9. shiftkey commented on Sep 20, 2018

    @shiftkey
    Member

    A couple of general questions:

    • We already generate a log file of interesting errors and slow Git operations - how does that relate to this work?
    • Have you had a chance to figure out how to instrument something in Desktop that would be generating this data? It'd be neat to see and poke at something live to show how it could plug into the app.
    • Have you thought about how we get our hands on this telemetry data? Telemetry itself is a word that worries some users because of how invasive it can be, and I'd love to figure out a way that we obtain consent from users for this info and obtain it in a way that doesn't require much work from either ourselves or users.
  10. iAmWillShepherd commented on Sep 20, 2018

    @iAmWillShepherd
    ContributorAuthor

    We already generate a log file of interesting errors and slow Git operations - how does that relate to this work?

    At the moment, it doesn't, but I think it should.

    @shiftkey shared this bit of code that controls how we log slow git operations. It may be worth creating another performance logger instance that way we could send slow git operations along with our normal stats package.

    if (startTime) {
    const rawTime = performance.now() - startTime
    if (rawTime > 1000) {
    const timeInSeconds = (rawTime / 1000).toFixed(3)
    log.info(`Executing ${cmd} (took ${timeInSeconds}s)`)
    }
    }

    Have you had a chance to figure out how to instrument something in Desktop that would be generating this data? It'd be neat to see and poke at something live to show how it could plug into the app.

    Not sure I understand what generating this data means...

    Have you thought about how we get our hands on this telemetry data? Telemetry itself is a word that worries some users because of how invasive it can be, and I'd love to figure out a way that we obtain consent from users for this info and obtain it in a way that doesn't require much work from either ourselves or users

    Yes, I spoke with @desktop/analytics and we are thinking we can use the work done over in atom/telemetry.

  11. shiftkey commented on Sep 20, 2018

    @shiftkey
    Member

    Not sure I understand what generating this data means...

    If we're looking to measure performance of parts of the app, what would developers working in the codebase need to do to opt-in for measuring their code and sending the details to this telemetry package? It doesn't have to be set in stone yet, but it'd be cool to bridge the gap between your document and getting something live.

    Some examples that I can think of, based on your spec:

    • can we get detailed timings from the native fetch API? from somewhere else?
    • the renderer periodically reading app.getProcessMemoryInfo() periodically to see how memory usage changes over time - does that give us enough detail?
    • how could a developer wireup components or stores to record the start and end time of a workflow?
  12. iAmWillShepherd commented on Sep 20, 2018

    @iAmWillShepherd
    ContributorAuthor

    how could a developer wireup components or stores to record the start and end time of a workflow?

    I'm singling out this question because to answer it depends on what we define a workflow to be and how we choose to represent one. In other words, we need to figure out what workflows exists, then figure out what steps that workflow is composed of. Once we have that info, I think we can use that to inform how we measure the time a workflow takes to complete.

  13. billygriffin commented on Sep 21, 2018

    @billygriffin
    Contributor

    Just want to call out that for memory usage in particular (we had some conversation around this relating to #3149 (comment)), one thing I think we want to make sure we're able to get is the distribution of users who are above some level of memory (ideally just the entire distribution). Averages don't tell me anything useful here, but if we knew that 10% of users had over some level of memory consumption that we consider to be unacceptable, that would be SUPER meaningful information.

    cc: @desktop/analytics

  14. Buchananm739 commented on Jun 18, 2019

    @Buchananm739
  15. added
    performance
    on Sep 23, 2020
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

    metaperformance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions