@wilshipley @phink0 [fast] Is this something you expect or something you measured? My measurements to date almost exclusively show opposite.
-
-
@mpweiher@wilshipley What am I doing wrong? Swift 6x slower than very naive ObjC filter. XCode7.3.1, [-O], iPhone5Spic.twitter.com/U20uvcRPFj
0 replies 3 retweets 9 likes -
@phink0@wilshipley That looks about smack in the middle of the relative slowdowns I have been seeing.0 replies 0 retweets 1 like -
@mpweiher@phink0@wilshipley That’s very interesting. Have you tried profiling it? Bridging overhead?0 replies 0 retweets 0 likes -
@mjtsai@mpweiher@wilshipley Here's the profile (and for completeness the ObjC simple/naive/ugly filter category)pic.twitter.com/lbeIS8sEg8
0 replies 0 retweets 1 like -
@phink0@mpweiher@wilshipley The Foundation -hasPrefix: does an exact compare; maybe Swift stdlib one does a fancy Unicode compare.0 replies 0 retweets 0 likes -
@mjtsai@phink0@mpweiher@wilshipley Yeah. Some Unicode operations are also implemented naively and make unnecessary extra copies.0 replies 0 retweets 2 likes -
@jckarter@mjtsai@phink0@wilshipley Dunno, I see “CFStringFindWithOptionsAndLocale()” in the profile and also when I profile -hasPrefix:0 replies 0 retweets 0 likes -
@mpweiher@jckarter@phink0@wilshipley If you look at the code, Swift is using kCFCompareNonliteral and NSString is not.0 replies 0 retweets 1 like -
@mjtsai@jckarter@phink0@wilshipley I no longer have access to Foundation source code…0 replies 0 retweets 0 likes
@mpweiher @jckarter @phink0 @wilshipley You can see in Hopper that it’s only passing NSAnchoredSearch.
-
@mjtsai@jckarter@phink0@wilshipley Just ran some tests and kCFCompareNonliteral does not make a difference with simple prefix comparison0 replies 0 retweets 2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Marcel Weiher
Marco Scheurer
Michael Tsai
Joe Groff