mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-06 01:05:48 +02:00
Make kitty --single-instance fast
No longer pay the overhead of starting the Python interpreter just to write a message to the single instance socket. This reduces the time for kitty --single-instance (for second and later instances) from 70ms to 3ms an almost 25x improvement. Needs testing on macOS and also porting of the +open handling.
This commit is contained in:
2
setup.py
2
setup.py
@@ -1286,7 +1286,7 @@ def build_launcher(args: Options, launcher_dir: str = '.', bundle_type: str = 's
|
||||
objects = []
|
||||
cppflags.append('-DKITTY_CLI_BOOL_OPTIONS=" ' + ' '.join(kitty_cli_boolean_options()) + ' "')
|
||||
cppflags.append('-DKITTY_VERSION="' + '.'.join(map(str, version)) + '"')
|
||||
for src in ('kitty/launcher/main.c',):
|
||||
for src in ('kitty/launcher/main.c', 'kitty/launcher/single-instance.c'):
|
||||
obj = os.path.join(build_dir, src.replace('/', '-').replace('.c', '.o'))
|
||||
objects.append(obj)
|
||||
cmd = env.cc + cppflags + cflags + ['-c', src, '-o', obj]
|
||||
|
||||
Reference in New Issue
Block a user