This repository has been archived by the owner on May 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use experimental (2 hop only) alternative to ssb-friends
- Loading branch information
Showing
16 changed files
with
315 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const PullPushable = require('pull-pushable') | ||
const Abortable = require('pull-abortable') | ||
|
||
module.exports = function PullPushAbort () { | ||
var aborter = Abortable() | ||
var stream = PullPushable(() => { | ||
if (aborter) { | ||
aborter.abort() | ||
aborter = null | ||
} | ||
stream.ended = true | ||
}) | ||
|
||
stream.aborter = aborter | ||
stream.ended = false | ||
|
||
return stream | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmckegg this code is mean as and hella clean! 😻 : i'd love to give better feedback but i haven't noticed anything yet after a few reads, nice work! 🙌
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, wish I had done this as a pull request so that it wasn't lost in multiple commits. Would have probably made reviewing a bit easier 😆
Anyway thanks!
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmckegg i'm having problems running with these commits.
i'm stuck on "Indexing database..."
it continues to fail at some point with
although i think each time i'm making progress towards the index being complete. 🙏
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahdinosaur Hmm, curious. Kind of looks like a problem with the unix socket?
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmckegg oh, that was noise, here's the real error 💥
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahdinosaur Wut!? Out of memory maybe?
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I really want to know what is calling deepEqual and triggering that.
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i reckon it's out of memory:
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm trying the Chrome memory profiler, but i'm not as experience as you with this so i can't make sense of what's happening.
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Record allocation timeline, and then see what takes up the most space.
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmckegg that's what i tried, but then it seemed like code took up the most space.
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops, wrong one. I mean allocation profile.
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be some kind of runtime memory usage that doesn't get stored. How quickly does it go to max heap size?
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I index that contacts thing, my heap size only grows to ~100 MB
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh oops, i was profiling the main window, not the server process. well now, it seems like the content of every message is hanging around in the heap. the heap grows quickly, in 1.6 minutes the allocation timeline was 723 MB.
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm not sure if i'm doing this right, but
seen
is huge?72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm that is concerning, that should only grow as you scroll back through the feed
How huge?
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
retained size is 143 556 704 or 35%. i'm not sure what retained size vs shallow size mean.
i wonder though, if somehow the new contacts system affected how messages became valid, and now nothing is valid so it keeps scrolling back? just a thought that came into my mind.
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
going back to your point on the phone: maybe i have a weird message in my feed that is tripping things up.
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AH, excellent thought. I don't think the feed waits until ssb-contacts has finished indexing before reading.
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ahdinosaur I have now updated it so that it doesn't start generating the public feed until the contact view finishes generating.
Try it and see if it works better now 🤔
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmckegg yes, it works! 🎆
72f1624
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mmckegg heh, guess we have been working on a similar problem. Have you seen https://github.com/ssbc/ssb-friend-pub?