-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OpenVPN: Restore and improve negotiation speed (#1095)
The new OpenVPN parser was painfully slow due to allocating NSRegularExpression zillion times, which resulted in poor performance (4x time!) when processing long PUSH_REPLY messages. This is a hard regression from v2 because [TunnelKit created the regexes statically](https://github.com/passepartoutvpn/tunnelkit/blob/339b509ddfd2838ee348d186e9a3016b0f8f447d/Sources/TunnelKitOpenVPNCore/ConfigurationParser.swift#L42). Solution: pre-allocate the regular expressions at parser creation time. Optimize long fragmented replies further by catching PUSH_REPLY continuations early, rather than parsing line by line.
- Loading branch information
Showing
6 changed files
with
113 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters