Skip to content

feature request: Add define to remove source_locations from each function #1111

Description

@kelbon

I dont see much reasons to have source location on each function as default arguments. Json is a hot path of many apps, performance is critical here, why there are source location on each .at without possibility to remove it?
I already have stacktrace from exception, i dont need source location

Activity

  1. vinniefalco commented on Sep 11, 2025

    @vinniefalco
    Member

    Interesting. I now wonder what is the performance overhead of the source locations...

  2. grisumbras commented on Sep 15, 2025

    @grisumbras
    Member

    The original PR doesn't show any performance degradation in automatic benchamarking: #835. Admittedly, those benchmarks don't really use throwing functions. I tried locally the benchmarks that do use those. The results aren't that significant either. So, as Vinnie said, measurements that show that such an option would result in improved performance are welcome.

  3. vinniefalco commented on Sep 15, 2025

    @vinniefalco
    Member

    Absent measurements it would be cool to see the generated object code. We could feature that in the Boost Diagnostics Suite literature, to show how it doesn't add measurable overhead (assuming that is the case)

  4. grisumbras commented on Aug 22, 2026

    @grisumbras
    Member

    Closing since OP wasn't responsive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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