Skip to content

Bad js_os_exec performance with high file descriptor limit #711

@bnoordhuis

Description

@bnoordhuis

js_os_exec tries to close all fds in the range 3..sysconf(_SC_OPEN_MAX). When ulimit -n is set to something high (1 million on my system), that takes considerable time.

Maybe the loop is the best we can do on other systems, but on linux, replacing it with close_range(3, INT_MAX, 0) should speed it up considerably.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions