Skip to content

Instantly share code, notes, and snippets.

@Ben-PH
Ben-PH / strace.md
Last active June 6, 2020 02:56
Comaprison of C and Rust syscalls on startup/shutdown.

Abstract

For some situations, understanding system calls made during processes start-up and shut-down can be valuable. For example, consider a shell-scripts long-running hot loop that runs a very short-running process. Thus it is perhaps reasonable to hypothesise that a difference in system calls during process start-up/shut-down has a non-negligable impact on the run time of said hot-loop.

This write-up looks at how C and Rust programs differ in terms of system-calls for start-up/shutdown. It is not intended as a performance analysis and only looks at one target system.

At the end, we take a quick look at using statically linked libraries by building with # cargo build --target x86_64-unknown-linux-musl --release and removing even more syscalls by removing the main function

System

@trusktr
trusktr / DefaultKeyBinding.dict
Last active May 17, 2024 01:58
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers