Skip to content

Conversation

@stephanwlee
Copy link
Contributor

Note that this changes vz-line-chart.

In this change, it:

  • update tooltip instaed of complete redraw. Tooltip, previously, threw
    away all items and created all rows anew on mouse move. It poorly
    scaled with number of rows (runs). Instead, we now use d3 way of
    creating and updating each row on mouse move.
  • reorganizes how tooltip is draw
  • optimizes calculation of finding nearest data point from dataset.
    Previously, it computed y-value for all data points (MxN) where
    M ~ 1000 and 1 <= N <= ~20. It calculates nearest point only based on
    x-value.
  • Wrap tooltip update around RAF. With large N and M, an update took
    long enough to miss one animation frame. Instead of doing an update
    right away, if we missed next animation frame, schedule an update
    onto the next animation frame.

@jart
Copy link
Contributor

jart commented Aug 15, 2018

Changing vz-line-chart has been known to be dangerous in the past, due to certain internal things that depend on it, which we're not able to test. Do you think we might want to copy this over to a vz-line-chart2 directory?

@stephanwlee
Copy link
Contributor Author

Got it. Just for my information, what specifically has happened in the past when changing vz-line-chart especially when it is a simple implementation change instead of API or behavioral change? Thanks!

@stephanwlee
Copy link
Contributor Author

Done with the fork. Thanks for the suggestion :D

Copy link
Contributor

@jart jart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest this be squashed down to two commits:

  1. Copy vz_line_chart to vz_line_chart2
  2. Improve tooltip redraw performance

Then force push, and use GitHub Rebase Merge.

Note that this changes vz-line-chart2, not vz-line-chart.
In this change, it:
- update tooltip instead of complete redraw. Tooltip, previously, threw
  away all items and created all rows anew on mouse move. It poorly
  scaled with number of rows (runs). Instead, we now use d3 way of
  creating and updating each row on mouse move.
- reorganizes how tooltip is draw
- optimizes calculation of finding nearest data point from dataset.
  Previously, it computed y-value for all data points (MxN) where
  M ~ 1000 and 1 <= N <= ~20. It calculates nearest point only based on
  x-value.
- Wrap tooltip update around RAF. With large N and M, an update took
  long enough to miss one animation frame. Instead of doing an update
  right away, if we missed next animation frame, schedule an update
  onto the next animation frame.
@stephanwlee stephanwlee merged commit cb5a8ca into tensorflow:master Aug 20, 2018
@stephanwlee stephanwlee deleted the perf branch August 20, 2018 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants