Skip to content

snmalloc pessimal performance in post-main cleanup #809

@akrieger

Description

@akrieger

While integrating snmalloc into https://github.com/CleverRaven/Cataclysm-DDA, I noticed a bizarre issue crop up: snmalloc seeming causing a hang post completion of the test binary. Profiling on Windows shows that it seems to spend all of its cycles repeatedly iterating some internal structure at exorbitant cost. I'm not sure if this is simply expected behavior due to a large number of deallocations at once or if it a bad interaction with post-main thread behavior violating snmalloc's assumptions.

The pull request for the integration is CleverRaven/Cataclysm-DDA#85099. I am using the 'header only' style build method with the following (simplified) contents to override just new/delete for Windows.

#define SNMALLOC_USE_WAIT_ON_ADDRESS 1
#ifndef _WIN32
#include <snmalloc/override/malloc.cc> // NOLINT(bugprone-suspicious-include)
#endif
#include <snmalloc/override/new.cc> // NOLINT(bugprone-suspicious-include)
Image Image

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