Skip to content

[stdlib] Uninline float description #20038

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 2 commits into from
Oct 25, 2018

Conversation

airspeedswift
Copy link
Member

May help with some code bloat caused by the new string interpolation.

@airspeedswift
Copy link
Member Author

@swift-ci please test

@airspeedswift
Copy link
Member Author

@swift-ci please benchmark

@airspeedswift airspeedswift requested a review from tbkka October 25, 2018 15:47
@airspeedswift
Copy link
Member Author

@tbkka I also removed some checks for inf that the C code was already handling. Be nice to remove the NaN check too but that results in more debug-style printing of nan that might not be desirable.

@airspeedswift
Copy link
Member Author

This would also mean we don't need to export swift_format_double

@swift-ci

This comment has been minimized.

@airspeedswift
Copy link
Member Author

@swift-ci please benchmark

@airspeedswift
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build comment file:

Performance: -O

TEST OLD NEW DELTA RATIO
Regression
IterateData 1720 1905 +10.8% 0.90x (?)

Code size: -O

TEST OLD NEW DELTA RATIO
Improvement
FloatingPointPrinting.o 7223 6583 -8.9% 1.10x

Performance: -Osize

TEST OLD NEW DELTA RATIO
Regression
Array2D 6612 7208 +9.0% 0.92x

Code size: -Osize

TEST OLD NEW DELTA RATIO
Improvement
FloatingPointPrinting.o 6576 5712 -13.1% 1.15x

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
RandomDoubleLCG 51076 63761 +24.8% 0.80x
How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false alarms. Unexpected regressions which are marked with '(?)' are probably noise. If you see regressions which you cannot explain you can try to run the benchmarks again. If regressions still show up, please consult with the performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 92f8f80

@airspeedswift
Copy link
Member Author

@swift-ci please clean test linux platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 92f8f80

@airspeedswift
Copy link
Member Author

Unrelated linux failures need #20036

@tbkka
Copy link
Contributor

tbkka commented Oct 25, 2018

Thanks for doing this! When I initially did this, I was a little alarmed at the amount of inlining going on, but never got back to it.

@tbkka I also removed some checks for inf that the C code was already handling. Be nice to remove the NaN check too but that results in more debug-style printing of nan that might not be desirable.

Regular description and debugDescription differ only in NaN printing. But you could handle that distinction further down in the code. Right now, I think the debug flag might be entirely ignored.

Copy link
Contributor

@tbkka tbkka left a comment

Choose a reason for hiding this comment

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

Looks good!

@airspeedswift
Copy link
Member Author

Cool. I'll merge this for now and we can revisit sinking the nan handling later, once it's not inlinable we have flexibility to do that whenever.

@airspeedswift
Copy link
Member Author

@swift-ci please test linux platform

@airspeedswift airspeedswift merged commit 116dac1 into swiftlang:master Oct 25, 2018
@airspeedswift airspeedswift deleted the float-description branch October 25, 2018 21:20
davidungar pushed a commit to davidungar/swift that referenced this pull request Oct 26, 2018
* Uninline float description

* Uninline _floatNNToString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants