Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

perf: avoid double-allocation for bool in TestNameFormatter.FormatArgumentValue #6030

Copy link
Copy link

Description

@thomhurst
Issue body actions

TUnit.Core/Services/TestNameFormatter.cs:53:

bool b => b.ToString().ToLowerInvariant(),

bool.ToString() allocates "True"/"False", then ToLowerInvariant() allocates again. Replace with the interned literals:

bool b => b ? "true" : "false",

Why hot: Every bool argument in every display-name format.
TFM: No gating.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance optimizationPerformance optimization

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.