Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: improve expr.toString performance #1706

Merged
merged 1 commit into from
Oct 15, 2024

Commits on Oct 15, 2024

  1. core: improve expr.toString performance

    Creating a string from the expression can be a common
    operation when creating messages. This change reduces
    the overhead by allowing it to be written to an existing
    builder instance and reduce the amount of internal
    resizing and copies.
    
    **Before**
    
    ```
    Benchmark           Mode  Cnt         Score       Error  Units
    withEscapes        thrpt   10    581,213.514 ± 4708.897  ops/s
    withNoEscapes      thrpt   10    643,706.596 ± 9144.301  ops/s
    ```
    
    **After**
    
    ```
    Benchmark           Mode  Cnt         Score       Error  Units
    withEscapes        thrpt   10    956,439.595 ±  5243.582  ops/s
    withNoEscapes      thrpt   10  1,031,542.340 ± 25261.261  ops/s
    ```
    brharrington committed Oct 15, 2024
    Configuration menu
    Copy the full SHA
    506e0a7 View commit details
    Browse the repository at this point in the history