[bisq-network/bisq] Clean up trade statistics from duplicate entries (#3476)

chimp1984 notifications at github.com
Sun Nov 10 04:09:50 UTC 2019


chimp1984 commented on this pull request.



> @@ -240,7 +242,12 @@ public void onMessage(NetworkEnvelope networkEnvelope, Connection connection) {
                                     // Processing 82645 items took now 61 ms compared to earlier version where it took ages (> 2min).
                                     // Usually we only get about a few hundred or max. a few 1000 items. 82645 is all
                                     // trade stats stats and all account age witness data.
-                                    dataStorage.addPersistableNetworkPayloadFromInitialRequest(e);
+
+                                    // We only apply it once from first response
+                                    if (!initialRequestApplied) {

The hash issue was caused by the extraMap where at certain updates data got added and combined with the republishing of the objects created dupicates entries as the hashes have been different due the added entries in that map (was used for tracking usage of arbitrators and mediators for a optimized selection of them). 

The optimisation for handling the PersistableNetworkPayload objects was to avoid performance spikes when processing a large set of PersistableNetworkPayload objects. For ProtectedStorageEntrys we do not expect such high amount of objects.  PersistableNetworkPayload are mainly Tradestatistic objects and AccountAgeWitnes objects and if a user have not been online for longer time those can be several 1000 objects which caused longer processing time if the normal method was used where unnecessary checks (as we got those obejcts at startup and not at runtime later) have caused most of the cpu costs.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/3476#discussion_r344471662
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191109/145c7179/attachment.html>


More information about the bisq-github mailing list