Use DateInterval instead of Carbon
What's the reason to use Carbon?
It's slower than DateInterval. Very slower.
It's slower than DateInterval. Very slower.
Can you please attach the benchmark results that you did?
FWIW, I think the issue is not that it's slower, but that it would better serve everyone if the SDK used standard primitives.
I do not think that Carbon leaks anywhere in user code, so it should be safe to optimize it in the future releases.
@rauanmayemir It is used internally. All public places are described by common DateTimeInterface and DateInterval classes and/or interfaces. Like this: https://github.com/temporalio/sdk-php/blob/master/src/Activity/ActivityOptions.php#L53
Approximately this difference in speed we will get when replacing "hot spots" with the native implementation (For example, sending the local temporal time to the server):

Now I will look at the rest of the "hot spots". To assess how critical the replacement is.
P.S. Yes, parsing time from the temporal server is 4 times longer:

And in theory we can win about ~0.00003s per 1 i/o.
Closing due to inactivity.