contour icon indicating copy to clipboard operation
contour copied to clipboard

Improve startup time on macOS

Open erf opened this issue 1 year ago • 2 comments
trafficstars

Abstract

Startup time now on macOS is about ~3 seconds whilst other popular terminals open in about 1 second.

Motivation

Specification

erf avatar Dec 22 '23 19:12 erf

Many thanks for all of your tickets, @erf. On this one, this is because it's an x86-64 build running on an Apple M1 (ARM64), where Apple Rosetta 2 is doing an initial JIT-transpiling into an ARM64 executable. I realise that Alacritty is faster, but Warp terminal is slower than Contour in startup-times.

I am sure there's something we can optimize in general startup performance, regardless of the platform (MacOS), which is initial font fallback discovery (because that's done at process startup, but could easily be cached, or lazy-loaded as needed).

We could also start providing native Apple M1 executables on the release page (I am mainly using an Apple M1 as well, where i'm - apart from running OS/X - also run ARM64 based Linux VMs daily). 🤔

christianparpart avatar Dec 22 '23 21:12 christianparpart

That makes sense! i Run on a m1 macbook. Building a universal build including Apple Silicon would probably make it much faster!

BTW: I tested against Terminal.app, iTerm2.app, Wezterm and Ghostty and they were all about 1 sec

erf avatar Dec 22 '23 22:12 erf

@erf Assuming you are (still) on ARM64 macOS, the startup-time should now be waaay better, because the next release (and master branch CI-builds) are native ARM64 (Apple silicon) builds.

I compared roughly against iTerm, Alacritty and Kitty. I think Kitty is still the fastest. But also, we did not really actually do any actual code path optimizations for startup-time (there is room for improvement, but this would then apply to every platform :) )

I am going to close this ticket now, because we're definitely down from 3s to way below 1s. If you feel the need for further improvement, please continue chatting here, join Discord, or subscribe to repo updates, because I'd still like to work on further improving general startup-time. :)

christianparpart avatar Jun 25 '24 22:06 christianparpart