@@ -7,7 +7,7 @@ compiler and make an effort to optimize and shrink the generated binaries. One
7
7
of the problems that we have today is that swift symbols are mangled into
8
8
extremely long strings. This is especially a problem for libraries, and almost
9
9
half of the size of libswiftCore.dylib (the swift runtime library on x86_64 OSX)
10
- is string tables. On MacOSX you can use the command ’ size -m file.dylib’ to read
10
+ is string tables. On MacOSX you can use the command " size -m file.dylib" to read
11
11
the size of the string table. C++ also suffers from the problem of long names,
12
12
but since we control the Swift ABI we can do better than C++.
13
13
@@ -99,15 +99,15 @@ the top 63 frequent substrings in our dictionary using two characters (escape +
99
99
The second escape character encodes a two-character reference that can access 63 x 63 entries in the table.
100
100
Less common substrings can be encoded using this three character sequence (escape + index0 + index1).
101
101
102
- One interesting bit of information is that the character ‘Y’ is only used 4
102
+ One interesting bit of information is that the character "Y" is only used 4
103
103
times in the entire standard library! The letter J, and a few other letters are
104
104
also not used very frequently. We use Y and J as escape characters.
105
105
106
106
The dictionary-based encoding uses the following rules:
107
107
108
108
1 . We use two escape characters that are not frequently used in names (Y and Z).
109
109
These characters are escape character and cannot be used as part of the text
110
- without escaping. ‘Y’ is encoded as ‘YY’ , and ‘Z’ would be encoded as ‘YZ’ .
110
+ without escaping. "Y" is encoded as "YY" , and "Z" would be encoded as "YZ" .
111
111
112
112
2 . The most commonly used sub-strings (calculated as length of substring times
113
113
number of occurrences) is encoded with a single escape character and a
@@ -216,7 +216,7 @@ Error handling
216
216
The compression routines only handle characters that are in the list of valid
217
217
characters. It is possible to compress every string that uses the valid
218
218
character set. However, now all incoming strings are legal. For example the
219
- string "Y" is illegal because 'Y' is an escape character and the decoded expects
219
+ string "Y" is illegal because "Y" is an escape character and the decoded expects
220
220
another character to follow the escape character.
221
221
222
222
There are a few users that will use the compression routines: The
0 commit comments