Open moisesvega opened 2 months ago
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
Summary
The procedure.ToName function, a frequently used pathway, currently relies on
fmt.Sprintf
to merge strings. However, this method could inadvertently cause additional memory allocations. By directly concatenating these strings instead of utilizing fmt and constructing a format template, we can reduce unnecessary allocations.This minor modification has the potential to enhance the efficiency of this library for all users.
Benchmark strategy
The strategy involves generating a string for both the serviceName and methodName, running a series of benchmarks, and then comparing the results using benchstat.
before.txt
after.txt
Results
bechstat result after running it with
go test -bench=. -count=100