Commits

Ben Langmuir committed 3a9020fae4e
Add an on-disk code completion cache When we miss the in-memory (libcache-based) code completion cache, we can now chain to an on-disk code completion cache. This drastically improves the time and peak memory usage it takes to do the first code completion (ie. before the in-memory cache is warm) if we've done the same lookup before. The on-disk cache, like the in-memory cache is tied to the specific compiled swift and clang module files (.swiftmodule and .pcm), and will consider itself out of date if they are modified. Responsibility for deleting completely dead/unreachable cache files falls to the client. Most of this commit is adding a simple serialization and deserialization for CodeCompletionResults and CodeCompletionStrings. The format is very simple, using an array of fixed size CodeCompletionResults, with offsets into two blobs: one for CodeCompletionString::Chunks, and one for strings. Currently that gives us about 5.8 MB for all the results in Cocoa, but it's very compressible if we decide we want to reduce it (gzip'd it is ~1.2 MB for the same data). Swift SVN r28369