Signal-iOS/Scripts
Evan Hahn 3c26cb56f7 Speed up compilation by tweaking emoji code
I profiled our Swift code with the following flags:

    -Xfrontend -warn-long-function-bodies=100 -Xfrontend -warn-long-expression-type-checking=100

Lots of stuff took longer than 100ms, but only one function took longer
than 10 seconds: `EmojiWithSkinTones#init(rawValue: String)` took 12
seconds. Presumably, this was because it had a call to `self.init` once
per emoji. Now we do it once, which cuts the compile time from ~12.3
seconds to ~1.9.

There was another long-running one, `emojiPerSkinTonePermutation`, which
also took a fairly long time, and this cut it down a bit.

There's more we can do to speed up our builds (see links below) and this
shouldn't change incremental ones much (unless you're changing these
files) but it was low-hanging fruit.

Resources to speed up builds, some of which are old:

- ["Build performance analysis for speeding up Xcode builds"][0]
- ["Improving the Speed of Incremental Builds"][1]
- ["How to make Swift compile faster"][2]
- ["Speed up Swift compile time"][3]
- ["Optimizing Swift build times"][4]
- ["Improving Swift compile times"][5]
- ["Regarding Swift build time optimizations"][6]

[0]: https://www.avanderlee.com/optimization/analysing-build-performance-xcode/
[1]: https://developer.apple.com/documentation/xcode/improving-the-speed-of-incremental-builds
[2]: https://www.hackingwithswift.com/articles/11/how-to-make-swift-compile-faster
[3]: https://medium.com/hackernoon/speed-up-swift-compile-time-6f62d86f85e6
[4]: https://github.com/fastred/Optimizing-Swift-Build-Times
[5]: https://www.swiftbysundell.com/articles/improving-swift-compile-times/
[6]: https://medium.com/@RobertGummesson/regarding-swift-build-time-optimizations-fc92cdd91e31
2022-04-23 11:27:39 -05:00
..
git_hooks dedupe git hooks 2018-03-02 17:57:58 -05:00
sds_codegen SSK: Remove obsolete OWSMessageDecryptJob 2022-04-11 14:46:43 -07:00
translation auto-genstrings: Fix OWSLocalizedString breakage 2022-04-05 10:48:05 -07:00
AuditStringH.py More Python 3 script fixes 2022-03-24 10:28:27 -05:00
bump_build_tag.py Scripts: subprocess.check_output should use text=True for compatibility 2022-03-24 17:28:12 -05:00
ClearDerivedData.sh Respond to CR. 2018-02-09 10:31:29 -05:00
debug_log_upload.py Scripts: subprocess.check_output should use text=True for compatibility 2022-03-24 17:28:12 -05:00
disableUniversalDeviceSupport More Python 3 script fixes 2022-03-24 10:28:27 -05:00
emoji_ranges.py Upgrade scripts to Python 3 2022-03-21 12:58:33 -05:00
emoji-data.txt Respond to CR. 2017-10-30 12:11:42 -04:00
EmojiGenerator.swift Speed up compilation by tweaking emoji code 2022-04-23 11:27:39 -05:00
enableUniversalDeviceSupport More Python 3 script fixes 2022-03-24 10:28:27 -05:00
feature_flags_beta.py Upgrade scripts to Python 3 2022-03-21 12:58:33 -05:00
feature_flags_common.py Scripts: subprocess.check_output should use text=True for compatibility 2022-03-24 17:28:12 -05:00
feature_flags_openPreview.py Upgrade scripts to Python 3 2022-03-21 12:58:33 -05:00
feature_flags_production.py Upgrade scripts to Python 3 2022-03-21 12:58:33 -05:00
feature_flags_qa.py Upgrade scripts to Python 3 2022-03-21 12:58:33 -05:00
HardResetGit.sh Hard reset git script. 2017-01-31 13:58:13 -05:00
precommit.py Speed up pre-commit script 2022-03-23 09:43:21 -05:00
ProtoWrappers.py More Python 3 script fixes 2022-03-24 10:28:27 -05:00
reverse_integration_check.py Fix Python deprecation warning in reverse integration check script 2022-04-09 16:36:44 -05:00
schema_dump Firm up database schema 2021-11-09 14:25:42 -08:00
set_release_notes Fix release notes 2021-05-02 11:51:36 -07:00
setup_private_pods Fix setup_private_pods script for newly-cloned repos 2022-01-28 10:04:00 -08:00
sqlclient PR Feedback, update schema_dump to support sqlclient updates 2020-08-20 13:07:23 -07:00
sqlclient-legacy sql client scripts 2019-04-05 10:50:45 -06:00
unused_strings.py Improve script to find unused strings 2022-04-15 15:28:15 -05:00
update_plist_info.sh A couple small changes to improve visibility of build configuration 2021-10-05 20:43:42 -07:00
update_share_plist_info.sh PR Feedback 2019-05-28 13:07:34 -07:00
upload_metadata Manage app store metadata with transifex 2021-04-22 12:53:43 -07:00