-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
subscription registry fixes and improvements #780
Conversation
src/utils/subscription-registry.js
Outdated
|
||
const names = this._names.get(socket) || new Set() | ||
if (names.size === 0) { | ||
this._names.set(socket, names) | ||
socket.once('close', this._onSocketClose) |
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.
this should be once per socket and not subscription
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.
@yasserf: It is once per socket. _names
gives the set of all subscription names for a specific socket.
@yasserf: Any feedback on this? Would be curious to see some performance numbers from your benchmark suite. |
Will be looking to get those public soon, generally looks great, thank you! |
Not sure why the last commit causes failure. Would appreciate some help debugging that. |
src/utils/subscription-registry.js
Outdated
|
||
if (this._subscriptionListener) { | ||
this._subscriptionListener.onSubscriptionRemoved( | ||
subscription.ame, |
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.
typo?
could it be because https://github.com/deepstreamIO/deepstream.io/blob/master/src/record/record-handler.js#L658 and u removed the silent flag for unsubscribing? |
Sorry for making this take so long, code looks awesome! Hoping to get results on it soon |
So the general idea here is to reduce the number of allocations and lookups and improve iteration performance.