commit | f0c73eb246a8a3dc76617f508d6303d5a6d30db4 | [log] [tgz] |
---|---|---|
author | Xianzhu Wang <wangxianzhu@chromium.org> | Tue Oct 26 19:33:14 2021 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Oct 26 19:33:14 2021 |
tree | d670857216b77b7e1c43cacbe419ec877e2b4ea2 | |
parent | b280541f94c26df6e367df76f7c1eb101fc7a97a [diff] |
Use std::max and std::min in gfx::(Point|Size|Vector2d)[F]::SetTo(Max|Min) We used code like a <= b ? a : b instead of std::max/min because the former performed better than the latter at the time. Now generated code [1] shows that the compiler can generate better code with std::max and std::min for these functions for x86_64. Performance tests with this CL on different platforms seem to show more slight progressions than regressions (see the pinpoint links in the change log in the gerrit page of this CL), but the changes might be just noise because repeated runs on the same platform with the same benchmark show different results. At least with std::min/std::max the code is shorter and is more readable. [1] https://docs.google.com/document/d/1ve9-XUWc5J_R9SLPDuENHDY_WiP2AEq2O_l7JH0fAEE/edit# Bug: 738465 Change-Id: Ieb3000c9c1a4a7f04540e5a4a252ed86b3864e30 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3243704 Reviewed-by: danakj <danakj@chromium.org> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/main@{#935090}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.