Skip to content

Instantly share code, notes, and snippets.

https://github.com/robbyrussell/oh-my-zsh/issues/5327
A Debugging Technique
I didn't read every post here, but I'm gonna post a technique for debugging slow startup just in case no one else has posted a good one yet.
If you install the moreutils package, you'll have a timestamp command called ts. You can use it to print sub second resolution timestamps of all of the debug output from zsh that tell you how long since the last line of output. Then you can search that file for timestamps that are "long". Here's the command:
zsh -xv 2>&1 | ts -i "%.s" > zsh_startup.log
Just hit 'ctrl-d' when the prompt pops up to exit the debug shell, and you can then read 'zsh_startup.log' with whatever you want. It'll be a long file, so find a good way to search it with regex. Keep in mind that zsh debug prints a line before running it, so the timestamps really tell you how long it took for the previous line to run, not the line the timestamp is currently on.
@lszinv
lszinv / CMakeLists.txt
Created September 15, 2020 02:17
Sample CMake
cmake_minimum_required(VERSION 3.17)
project(overiew_project)
set(CMAKE_CXX_STANDARD 17)
include(${CMAKE_ROOT}/Modules/ExternalProject.cmake)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/")
##################
## Dependencies
##################