Closed djaglowski closed 1 month ago
For context, ToNative
was observed to be wasting ~5% of compute on a real world configuration.
Pinging code owners:
pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley
See Adding Labels via Comments if you do not have permissions to add labels yourself.
Pinging code owners for pkg/ottl: @TylerHelmuth @kentquirk @bogdandrutu @evan-bradley. See Adding Labels via Comments if you do not have permissions to add labels yourself.
@djaglowski I'm interested in fixing this performance issue, but I don't see any connection to timeutils.ParseStrptime
from ParseJSON.
I only see timeutils.ParseStrptime
called from the Time
converter. I suspect your proposal could be implemented there.
Sorry, I got some wires crossed looking at several issues at once. ParseJSON
is not the function in question. It should read Time
instead. I've now corrected the wording above.
Component(s)
pkg/ottl
Describe the issue you're reporting
Currently, the
Time
function runstimeutils.ParseStrptime
for every string that needs to be parsed as atime.Time
. This in turn callsctimefmt.ToNative
, which is doing a deterministic string replacement operation.The OTTL function should instead call
timeutils.StrptimeToGotime
once at collector startup, and then calltimeutils.ParseGotime
during normal operations.