Skip to content

Instantly share code, notes, and snippets.

View drescherjm's full-sized avatar

John M. Drescher drescherjm

View GitHub Profile
@rpavlik
rpavlik / CMakeBoostHelper.cmake
Created November 14, 2014 16:22
Script to help CMake find Boost from the new installers
# Original author: Ryan Pavlik <ryan@sensics.com> <ryan.pavlik@gmail.com
# Released with the same license as needed to integrate into CMake.
# Help CMake find recent Boost MSVC binaries without manual configuration.
if(MSVC AND (NOT Boost_INCLUDE_DIR OR NOT Boost_LIBRARY_DIR))
math(EXPR _vs_ver "${MSVC_VERSION} / 100 - 6")
if(CMAKE_CXX_SIZEOF_DATA_PTR EQUAL 8)
set(_libdir "lib64-msvc-${_vs_ver}.0")
else()
set(_libdir "lib32-msvc-${_vs_ver}.0")
@brendangregg
brendangregg / fsmicrobench.md
Last active February 16, 2022 08:25
some FS micro-benchmarks

F1. FS 128k streaming writes

Benchmark: fio write

Command: fio --name=seqwrite --rw=write --bs=128k --size=4g --end_fsync=1 --loops=4 # aggrb tput

Rationale: Measure the performance of a single threaded streaming write of a reasonably large file. The aim is to measure how well the file system and platform can sustain a write workload, which will depend on how well it can group and dispatch writes. It's difficult to benchmark buffered file system writes in both a short duration and in a repeatable way, as performance greatly depends on if and when the pagecache begins to flush dirty data. As a workaround, an fsync() at the end of the benchmark is called to ensure that flushing will always occur, and the benchmark also repeats four times. While this provides a much more reliable measurement, it is somewhat worst-case (applications don't always fsync), providing closer to a minimum rate – rather than a maximum rate – that you should expect.

F2. FS cached 4k random reads

@QuantumCD
QuantumCD / Qt 5 Dark Fusion Palette
Created August 15, 2013 21:40
This is a complete (I think) dark color palette for the Qt 5 Fusion theme, as well as a nice style sheet for the tool tips that make them blend better with the rest of the theme. To have immediate effect, be sure to put this in your main function before showing the parent window. Child windows should automatically inherit the palette unless you …
qApp->setStyle(QStyleFactory::create("Fusion"));
QPalette darkPalette;
darkPalette.setColor(QPalette::Window, QColor(53,53,53));
darkPalette.setColor(QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Base, QColor(25,25,25));
darkPalette.setColor(QPalette::AlternateBase, QColor(53,53,53));
darkPalette.setColor(QPalette::ToolTipBase, Qt::white);
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
darkPalette.setColor(QPalette::Text, Qt::white);