Skip to content

Slow startup, possibly due to too many calls to getpid() #2754

@misev

Description

@misev

Describe the bug
kitty takes ~0.6s to start on my machine which is perceptibly quite slow.
I ran it with strace which showed that most of the time is spent in a lot of (~80,000) calls to getpid()

293934 1591634753.176957 brk(0x202d000) = 0x202d000 <0.000010>
293934 1591634753.182584 brk(0x204e000) = 0x204e000 <0.000012>
293934 1591634753.185616 getpid()       = 293934 <0.000008>
293934 1591634753.185649 getpid()       = 293934 <0.000006>
293934 1591634753.185679 getpid()       = 293934 <0.000006>
293934 1591634753.185715 getpid()       = 293934 <0.000006>
293934 1591634753.185741 getpid()       = 293934 <0.000005>
293934 1591634753.185769 getpid()       = 293934 <0.000004>
...
293934 1591634754.457158 getpid()       = 293934 <0.000003>
293934 1591634754.457171 getpid()       = 293934 <0.000003>
293934 1591634754.457184 getpid()       = 293934 <0.000003>
293934 1591634754.457197 getpid()       = 293934 <0.000003>
293934 1591634754.457210 getpid()       = 293934 <0.000003>
293934 1591634754.457223 getpid()       = 293934 <0.000003>
293934 1591634754.457236 getpid()       = 293934 <0.000003>

You can check with strace -f -ttt -T -o strace-analysis.txt kitty

Expected behavior
The startup is perceptibly slow, I'd expect it to be faster. The --single-instance option makes no difference.

Enviroment details
OS: Kubuntu 20.04

kitty 0.17.4 (3d32202b3a) created by Kovid Goyal
Linux hifi 5.4.0-33-generic #37-Ubuntu SMP Thu May 21 12:53:59 UTC 2020 x86_64
Ubuntu 20.04 LTS \n \l
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04 LTS"
Loaded config files: /etc/xdg/kitty/kitty.conf, /home/dimitar/.config/kitty/kitty.conf
Running under: X11

Config options different from defaults:
active_tab_title_template  {title}
allow_remote_control       y
background                 Color(red=28, green=40, blue=54)
bold_font                  Iosevka Term Heavy
bold_italic_font           Iosevka Term Heavy Italic
color1                     Color(red=249, green=85, blue=95)
color10                    Color(red=52, green=187, blue=153)
color11                    Color(red=255, green=255, blue=85)
color12                    Color(red=88, green=156, blue=245)
color13                    Color(red=231, green=85, blue=152)
color14                    Color(red=57, green=120, blue=187)
color2                     Color(red=32, green=175, blue=137)
color3                     Color(red=253, green=240, blue=41)
color4                     Color(red=88, green=156, blue=245)
color5                     Color(red=147, green=77, blue=149)
color6                     Color(red=30, green=158, blue=230)
color7                     Color(red=187, green=187, blue=187)
color8                     Color(red=84, green=84, blue=84)
color9                     Color(red=250, green=139, blue=142)
cursor                     Color(red=187, green=187, blue=187)
enable_audio_bell          False
font_family                Iosevka Term Medium
font_size                  12.0
foreground                 Color(red=255, green=255, blue=255)
italic_font                Iosevka Term Medium Italic
repaint_delay              16
scrollback_lines           50000
select_by_word_characters  :@-./_~?&=%+#
selection_background       Color(red=180, green=213, blue=255)
selection_foreground       Color(red=28, green=40, blue=54)
single_window_margin_width FloatEdges(left=-1000.0, top=-1000.0, right=-1000.0, bottom=-1000.0)
strip_trailing_spaces      smart
tab_bar_edge               1
window_margin_width        FloatEdges(left=1.0, top=1.0, right=1.0, bottom=1.0)
Added shortcuts:
	control+page_up KeyAction(func='previous_tab', args=())
	control+page_down KeyAction(func='previous_tab', args=())
Changed shortcuts:
	shift+control+w KeyAction(func='close_tab', args=())

Additional context
kitty --config NONE doesn't change the startup time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions