Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize trade chart view [6] #5794

Merged
merged 12 commits into from
Nov 9, 2021

Commits on Nov 9, 2021

  1. Move getAveragePrice and roundToTick to ChartCalculations

    Make buildUsdPricesPerTickUnit static and pass params
    Rename usdPriceMapsPerTickUnit to usdAveragePriceMapsPerTickUnit
    Rename local variable map to usdAveragePriceMap
    
    Move method calls syncPriceFeedCurrency() and
    setMarketPriceFeedCurrency() before other calls (those will become async later)
    chimp1984 committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    c51060a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    deeb912 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ea66a51 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    0271af9 View commit details
    Browse the repository at this point in the history
  5. Add static method getTradeStatisticsForCurrency and

    use it instead of updateSelectedTradeStatistics
    (preparation for follow up commit)
    chimp1984 committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    ca145b0 View commit details
    Browse the repository at this point in the history
  6. Add CompletableFutureUtils

    Convenience util for CompletableFuture.allOf method
    chimp1984 committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    603e9fd View commit details
    Browse the repository at this point in the history
  7. Add async handling with CompletableFuture to fillList

    The creation of TradeStatistics3ListItem is rather fast but the
    applying to the list is due sorting pretty slow (300 ms) as
    its > 100k items. We do the applying on the callback thread.
    Seems JavaFx permits that. So we can keep the UI thread unblocked.
    
    Remove modelReadyListener
    
    Renamed model.selectedTradeStatistics to model.tradeStatisticsByCurrency
    chimp1984 committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    65706e7 View commit details
    Browse the repository at this point in the history
  8. Run getUsdAveragePriceMapsPerTickUnit and getTradeStatisticsForCurrency

    in parallel and once both are done we call asyncUpdateChartData (not yet refactored).
    
    Clear all data at deactivate
    This cause a bit of costs when we activate again but as we delegate
    now all work to threads it should be OK. It decreases the memory usage
    if we do not keep those data in the fields. The View classes are cached
    in the view loader so all data in fields stays in memory once it was
    activated once and not manually cleared in deactivate.
    
    Move getTradeStatisticsForCurrency to ChartCalculations
    Rename buildUsdPricesPerTickUnit to getUsdAveragePriceMapsPerTickUnit
    Rename selectedTradeStatistics to tradeStatisticsByCurrency
    Make itemsPerInterval final
    Remove modelReady
    Add deactivateCalled flag
    chimp1984 committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    7ad5993 View commit details
    Browse the repository at this point in the history
  9. Move getUpdateChartResult, getCandleData, getTimeFromTickIndex to Cha…

    …rtCalculations
    
    Make maxTicks static and rename to MAX_TICKS
    chimp1984 committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    041b07e View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    ce8a91f View commit details
    Browse the repository at this point in the history
  11. Do sorting on non UI thread as its slow and only attach

    it to table in UI thread afterwards.
    
    Chain updateSelectedTradeStatistics and updateChartData calls.
    chimp1984 committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    a659a78 View commit details
    Browse the repository at this point in the history
  12. Fix package statement

    chimp1984 committed Nov 9, 2021
    Configuration menu
    Copy the full SHA
    c209da7 View commit details
    Browse the repository at this point in the history