blockchainprojects / bitshares-ui

Graphical User Interface for BitShares Blockchain
https://wallet.bitshares.org
MIT License
0 stars 1 forks source link

Analyze exchange performance #2991 #171

Open sschiessl-bcp opened 5 years ago

sschiessl-bcp commented 5 years ago

https://github.com/bitshares/bitshares-ui/issues/2991

VerevkinAlexander commented 5 years ago

Please review intermediate results of exchange performance analysis.

1) Visual evaluation Steps to check: ● open http://localhost:8080/market/CNY_BTS ● open the console ● turn on Highlighting Component Updates in в React Developer Tools Results: ● Rerenderings mostly occur at some intervals (about 3 seconds) if you don't interact with the UI . ● Together with the rerenderings a new message comes to the console: MarketsStore.js:992 Construct limit orders 1.3.113_1.3.0: 4.919921875ms. ● The entire Exchange component is redrawn. ● Rarely there are single child components redrawn out of turn.

Many of the components have no changes in them (such as order creation forms or the empty My open orders list), so they may not be redrawn.

image

image

2) Profiling Steps to check: ● recorded a profile using the Chrome Performance Tab profiler

Results: ● The profile shows that renderings are repeated every 2.6 - 3.2 seconds. The period remains the same regardless of CPU performance.

image

● The profile shows which components are being redrawn. image

● You can also see that all renderings begin with a message to the console: “Construct limit orders”

image

The screenshot below shows which components are being redrawn and at what intervals. AltContainer -> BindToChainState(ExchangeSubscriber) -> ExchangeSubscriber -> Exchange and their children are marked in red. Green marks are given to BindToChainState(Footer) -> Footer and AltContainer -> NotificationStatic and their children. The Construct limit orders message to the console is marked in blue. image

3) The "why-did-you-update" library check I have tried to use the "why-did-you-update" library. It provides a list of unnecessary re-renderings.

image

VerevkinAlexander commented 5 years ago

As for "how many subscriptions do we end up with? (in ChainStore)" question. Component “ExchangeSubscriber” subscribes to currentAccount, coreAsset, quoteAsset, baseAsset properties in ChainStore. "Exchange" component has 8 subscriptions. So in total: 12.