David Smith on Nostr: Misc String speedups in the beta versions of Swift + Foundation (send me bugs if you ...
Misc String speedups in the beta versions of Swift + Foundation (send me bugs if you run into problems!):
* Most NSString methods that take encoding params are much faster on bridged Strings for UTF8
* -getBytes:… is faster, especially concurrently
* -stringByAppendingString: then bridging no longer produces weirdly slow Strings
* -length is faster, much faster on NSStrings created by String(decoding: as: UTF16.self)
* NSDictionary -> Dictionary<String, Any> is at least 25% faster
#wwdc
Published at
2026-06-08 22:07:38 UTCEvent JSON
{
"id": "e31f0247fd58db27bb71dc04c7478de329a7356fb9082e8ca053e9fee8f25e15",
"pubkey": "4c5149865adbfe714a67c19f6fe497125ee8dff070e5715c07347c9590d63e9f",
"created_at": 1780956458,
"kind": 1,
"tags": [
[
"t",
"wwdc"
],
[
"proxy",
"https://mastodon.social/users/Catfish_Man/statuses/116716762494164748",
"activitypub"
],
[
"client",
"Mostr",
"31990:6be38f8c63df7dbf84db7ec4a6e6fbbd8d19dca3b980efad18585c46f04b26f9:mostr",
"wss://relay.ditto.pub"
]
],
"content": "Misc String speedups in the beta versions of Swift + Foundation (send me bugs if you run into problems!):\n\n * Most NSString methods that take encoding params are much faster on bridged Strings for UTF8\n * -getBytes:… is faster, especially concurrently\n * -stringByAppendingString: then bridging no longer produces weirdly slow Strings\n * -length is faster, much faster on NSStrings created by String(decoding: as: UTF16.self)\n * NSDictionary -\u003e Dictionary\u003cString, Any\u003e is at least 25% faster\n\n#wwdc",
"sig": "5cbc5cddfa7caae86fe362e38eb3ef211bdf1088e84e63b4341c5d3f7526d7237df85c5cb211217a31b844327340e989eaf88afa7c296cc1542851311c06ee08"
}