Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid calling fmod twice in roundLayoutResultsToPixelGrid (facebook#4…
…8404) Summary: X-link: facebook/litho#1036 X-link: facebook/yoga#1775 ## Changelog: [Internal] - This popped up when profiling some heavy UI performance, calling `fmod` operation in Yoga's `roundLayoutResultsToPixelGrid` in `PixelGrid.cpp` can be expensive, furthermore it turns out that some of the calls were redundant. This replaces the duplicate calls to fmod with an equivalent single round operation, which for e.g. clang compiler on Windows brings the code in question from ~50 instructions (including 4 call instructions to the fmod function) down to ~30 instructions (without any external calls), and the layout operation being **~1% more efficient** for the particular benchmark I was looking into. Differential Revision: D67689065
- Loading branch information