Skip to content

Feat/pull mplex#2

Closed
dryajov wants to merge 40 commits intomasterfrom
feat/pull-mplex-cnt
Closed

Feat/pull mplex#2
dryajov wants to merge 40 commits intomasterfrom
feat/pull-mplex-cnt

Conversation

@dryajov
Copy link
Copy Markdown
Member

@dryajov dryajov commented May 10, 2018

UPDATE: This is now ready for review.

TODO:

  • Performance
    • pool channel objects (should come next, but not critical for first release)

Bellow are the accompanying PRs:


The current implementation takes around ~15mins more running the mega stress tests defined in interface-stream-muxer.

Here is the outline:

New:

screen shot 2018-04-21 at 11 08 05 am

Old:

screen shot 2018-04-21 at 6 32 53 pm


The issue is here - https://github.com/libp2p/pull-mplex/blob/850bbc52c33038f2cdeff40e83afbcf4823b3895/src/coder.js#L85...L89. I need to rework this part to use a preallocated buffer, instead of allocating it every time.


Perf:

I was able to shave off ~15 mins of the new implementations running the mega stress tests, the perf is now about the same (or a little better ;) ) than the stream based implementation.

screen shot 2018-04-27 at 7 13 30 pm

Archive.zip

The attached zip contains a heap snapshot and a perf log taken with node --prof --nologfile_per_isolate --logfile=xxxxxx.log --log-timer-events /private/var/folders/_r/6c6jf6m10kb3v9kt45qspw4w0000gn/T/v8profilerProxy.js. The one thing that still irks me a bit is the excessive (compared to the prev implementation) GC time. I think we can improve that a lot by pooling the Channel objects and reusing them, rather than creating new ones every time.

Here is a screenshot from the perf log graph - GC is seems to take ~13% of the total time. (These graphs where generated using the attached logs, and webstorm perf and heap analyzers).

screen shot 2018-04-27 at 7 28 07 pm

screen shot 2018-04-27 at 7 27 54 pm

@ghost ghost assigned dryajov May 10, 2018
@ghost ghost added the status/in-progress In progress label May 10, 2018
@dryajov
Copy link
Copy Markdown
Member Author

dryajov commented May 10, 2018

creating new PR since the original got horked badly - #1

@dryajov dryajov changed the title Feat/pull mplex cnt Feat/pull mplex May 10, 2018
@dryajov dryajov mentioned this pull request May 10, 2018
2 tasks
@dryajov dryajov closed this May 10, 2018
@ghost ghost removed the status/in-progress In progress label May 10, 2018
This was referenced May 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant