Skip to content

this.sockets.indexOf is O(n) ? is there a reason to not use a hash array instead ? #2079

@kapouer

Description

@kapouer

Hi,
when trying to figure out why latest socket.io has CPU load climbing a bit too fast (70% on one core with around 5.000 clients), this was found:
https://github.com/Automattic/socket.io/blob/916872587fd6e0280e9538f712b91d0460bc3a2b/lib/namespace.js#L191
before i try to see if that can be optimized, i'd welcome some advice from the author(s), please.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions