Skip to content

intl extension couple of micro optimisations for error edge cases. #10044

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

Merged
merged 1 commit into from
Jan 14, 2023

Conversation

devnexen
Copy link
Member

@devnexen devnexen commented Dec 3, 2022

making c++ compile time few enums ranges.

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

Frankly, I don't know whether marking these conditions as UNEXPECTED buys us much (PGO is not unlikely to provide even better results), but I don't think they hurt in any way.

I'm less sure about using constexpr, though. Maybe @sgolemon can comment on that.

@@ -37,7 +37,7 @@ using icu::GregorianCalendar;
using icu::StringPiece;
using icu::SimpleDateFormat;

static const DateFormat::EStyle valid_styles[] = {
static constexpr DateFormat::EStyle valid_styles[] = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

constexpr is a C++11 feature; I'm not sure whether we can require it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the issue that REHL 7 is still not EOL and the GCC version which comes bundled doesn't support C11/C++11 fully?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

g++ 4.8 supports the vast majority of C++ 11 features, we already use smart pointers, another C++11 nicety, since 8.2.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, well then I suppose it should be fine?

@devnexen devnexen requested a review from iluuu1994 January 4, 2023 21:08
Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PGO is not unlikely to provide even better results

Likely, but I don't think most people do that.

@cmb69
Copy link
Member

cmb69 commented Jan 13, 2023

Well, the official Windows builds do some very basic PGO, and that could be extended (it was prior to PHP 7.4), but I doubt that a general PGO is really that useful. However, well PGO optimized applications may benefit greatly.

@devnexen devnexen merged commit 690db97 into php:master Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants