-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ext/date: various optimizations of _php_gettimeofday #18560
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes themselves are correct, optimisation"s" is only about the output though.
$get_as_float = false; | ||
|
||
// Calling gettimeofday() with all possible arguments | ||
var_dump( gettimeofday($get_as_float) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't change test cases at the same time as actual code changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't change the test case. It's only removal of unnecessary variables and comments. There is no functional change.
@@ -66,7 +66,7 @@ static void _php_gettimeofday(INTERNAL_FUNCTION_PARAMETERS, int mode) | |||
|
|||
offset = timelib_get_time_zone_info(tp.tv_sec, get_timezone_info()); | |||
|
|||
array_init(return_value); | |||
array_init_size(return_value, 4); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this really improve things a lot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same change as in recent PR #18382
Not much, but still something.
Pre-allocated size of array for
_php_gettimeofday
and improved typing.