pikers / piker

(e2e) foss trading for non-tinas
GNU Affero General Public License v3.0
103 stars 17 forks source link

Faster y-range sorting #325

Open goodboy opened 2 years ago

goodboy commented 2 years ago

After #302 lands there are 2 main sources of latency left in chart interaction:

In order to see this latency in action pass a --profile 10 to your piker chart command to see something like:

 > Entering `ChartView._set_yrange()`: `dolla_vlm`
    callback ._maxmin(): (0, 22800345.0): 24.8241 ms
    set limits: (-1368020.7, 24168365.7): 0.1694 ms
  < Exiting `ChartView._set_yrange()`: `dolla_vlm`, total time: 24.9964 ms
    > Entering `<piker.ui._chart.ChartPlotWidget object at 0x7f8b66fcae60>.maxmin(name=trade_rate)`: `volume`
      volume got bars range: 0.0380 ms
      yrange mxmn: (0, 1299940) -> (0.0, 0.0): 16.0576 ms
    < Exiting `<piker.ui._chart.ChartPlotWidget object at 0x7f8b66fcae60>.maxmin(name=trade_rate)`: `volume`, total time: 16.1166 ms
    > Entering `<piker.ui._chart.ChartPlotWidget object at 0x7f8b66fcae60>.maxmin(name=dark_trade_rate)`: `volume`
      volume got bars range: 0.1704 ms
      yrange mxmn: (0, 1299940) -> (0.0, 0.0): 12.8711 ms
    < Exiting `<piker.ui._chart.ChartPlotWidget object at 0x7f8b66fcae60>.maxmin(name=dark_trade_rate)`: `volume`, total time: 13.0730 ms
  > Entering `ChartView._set_yrange()`: `trade_rates`
    callback ._maxmin(): (0, 0): 29.5531 ms
    set limits: (0.0, 0.0): 0.2536 ms
  < Exiting `ChartView._set_yrange()`: `trade_rates`, total time: 29.8102 ms

Strategy to solve this: demire?

goodboy commented 2 years ago

this should help drive https://github.com/goodboy/tractor/issues/175 as well