Permalink
Browse files

[CodeSize] Disable the inlining of measureExtendedGraphemeCluster.

I am using Erik's inliner analysis tool to identify areas where the inliner is
too aggressive. In this commit I disabled the inlining of the method
measureExtendedGraphemeCluster. This change reduced the size of the swift
standard library by about 45k (2% of the .text size). I did not see any
performance regressions on the performance test suite.
  • Loading branch information...
nadavrot committed Feb 26, 2016
1 parent 3f43950 commit 493f4e3747ce2f7faf238b809a17018593dc1bb9
Showing with 2 additions and 0 deletions.
  1. +2 −0 stdlib/public/core/StringCharacterView.swift
@@ -126,6 +126,7 @@ extension String.CharacterView : CollectionType {
/// Returns the length of the first extended grapheme cluster in UTF-16
/// code units.
@warn_unused_result
@inline(never)
internal static func _measureExtendedGraphemeClusterForward(
start: UnicodeScalarView.Index
) -> Int {
@@ -167,6 +168,7 @@ extension String.CharacterView : CollectionType {
/// Returns the length of the previous extended grapheme cluster in UTF-16
/// code units.
@warn_unused_result
@inline(never)
internal static func _measureExtendedGraphemeClusterBackward(
end: UnicodeScalarView.Index
) -> Int {

2 comments on commit 493f4e3

@rudkx

This comment has been minimized.

Show comment
Hide comment
@rudkx

rudkx Feb 26, 2016

Member

👍 Nice targeted improvement.

Member

rudkx replied Feb 26, 2016

👍 Nice targeted improvement.

@jckarter

This comment has been minimized.

Show comment
Hide comment
@jckarter

jckarter Feb 26, 2016

Member

Nice catch!

Member

jckarter replied Feb 26, 2016

Nice catch!

Please sign in to comment.