[bisq-network/bisq] Reduce initial request size (#4233)
Florian Reimair
notifications at github.com
Tue Sep 1 12:54:13 UTC 2020
@freimair commented on this pull request.
> + public Map<P2PDataStorage.ByteArray, PersistableNetworkPayload> getMap(String filter) {
+ HashMap<P2PDataStorage.ByteArray, PersistableNetworkPayload> result = new HashMap<>();
+ result.putAll(store.getMap());
+
+ // TODO do a proper language, possibly classes
+ if (filter.startsWith("since ")) {
+ String finalFilter = filter.replace("since ", "");
+ if (!finalFilter.equals(Version.VERSION)) {
+ history.entrySet().stream()
+ .filter(entry -> parseSpecialKey(entry.getKey()) > parseSpecialKey(finalFilter))
+ .forEach(entry -> result.putAll(entry.getValue().getMap()));
+ }
+ }
+
+ return result;
+ }
you are correct, YAGNI right now. However, that will change swiftly once we get to reducing the memory footprint (which will start with https://github.com/bisq-network/projects/issues/29)
--
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/4233#discussion_r481114506
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200901/a4725e9a/attachment.html>
More information about the bisq-github
mailing list