After a lot of work I can confidently say that compiling Black with mypyc will bring excellent performance wins. On average, the time taken to format a file is halved, excluding startup time. Not all files are treated to the same boost though, quite a few files saw even better improvements (up to 2.38x!) and obviously some files didn't see as good improvements.
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
[21:02:18] Loaded first analysis: /home/ichard26/programming/oss/black/more-consistent-spacing-compiled.json (cached) | |
Loaded second analysis: /home/ichard26/programming/oss/black/hug-power-op-compiled-4.json (cached) | |
╭───────────────────────── Summary ──────────────────────────╮ | |
│ 11 projects & 230 files changed / 1586 changes [+793/-793] │ | |
│ │ | |
│ ... out of 2 020 758 lines, 9650 files & 23 projects │ | |
╰────────────────────────────────────────────────────────────╯ | |
[django - https://github.com/django/django.git] |
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
#!/usr/bin/env python | |
import os | |
import time | |
import shutil | |
import socket | |
import subprocess | |
import sys | |
import threading | |
from contextlib import contextmanager | |
from pathlib import Path |
I hereby claim:
- I am ichard26 on github.
- I am ichard26 (https://keybase.io/ichard26) on keybase.
- I have a public key whose fingerprint is 968D A450 8AD2 9495 907A 81D9 8B53 BCCC 2CD0 8DD2
To claim this, I am signing this object: