Commits

Roman Levenstein committed 0b5157b1047
Reduce the amount of memory required for caching protocol conformances. The reason for this patch: - Currently, when we invoke swift_conformsToProtocol for the first time, we load ALL protocol conformances into conformances cache (to avoid rescanning the conformances section next time), which consumes about 50-70KB of memory even per minimal Swift application (e.g. hello-world app). While it may seem not so much, if you think about apps running on watchOS or writing daemons in Swift (and we have about 120 of those running on iOS), it is a lot of memory. - In reality, only a couple of those conformances are used by applications, which means that most of the loaded conformances are useless and just consume the memory. The implemented solution: - Load only the conformances which were queried by calling swift_conformsToProtocol. Don’t try to load any other conformances, when not asked to do so. - Use std::vector instead of std::deqeue for SectionsToScan. This shaves off another 4KB of memory, because std::deque reserves at least 4KB by default. This patch does not seem to produce any detectable performance hit on our benchmark suite. With these changes, the minimal "hello world" application consumes only 9.8KB, whereas before it used to consume 60KB. rdar://22331482 Swift SVN r31310