mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[InterfaceFile] Improve flag extraction from interface file
Improve the version/flags extract from interface file by moving away from using Regex and limiting the search to the beginning of the file. Switch away from Regex will give 5-10% improvement in time and instruction counts, and limiting the search lines can save a lot of time if the swiftinterface is large. For example, the extract time for Swift stdlib is 10x faster after the patch. Current strategey for limiting the line to search is by only parsing the first comment block.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
// The "flags" line in this test deliberately has no flags and no space after
|
||||
// the colon, just to make sure that works (even though it'll never be printed
|
||||
// that way).
|
||||
|
||||
// swift-module-flags:
|
||||
// swift-interface-format-version: 1.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user