That's because Character is very, very different from ASCII in Swift (a character in Swift holds an extended grapheme cluster. See
https://developer.apple.com/reference/swift/character). I also doubt the way they compute its ASCII value is optimal:
extension Character {
var asciiValue: UInt32? {
return String(self)
.unicodeScalars
.filter{$0.isASCII}
.first?
.value
}
}
Certainly if it is optimal, but probably also if it isn't, I would change the program to not do that conversion in inner loops.