- Create
UNLOGGED
table. This reduces the amount of data written to persistent storage by up to 2x. - Set
WITH (autovacuum_enabled=false)
on the table. This saves CPU time and IO bandwidth on useless vacuuming of the table (since we neverDELETE
orUPDATE
the table). - Insert rows with
COPY FROM STDIN
. This is the fastest possible approach to insert rows into table. - Minimize the number of indexes in the table, since they slow down inserts. Usually an index
on
time timestamp with time zone
is enough. - Add
synchronous_commit = off
topostgresql.conf
. - Use table inheritance for fast removal of old data:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: | |
- all | |
remote_user: root | |
tasks: | |
- name: update everything | |
apt: upgrade=dist force_apt_get=yes autoclean=yes | |
- name: check if a reboot is necessary | |
register: reboot_required_file | |
stat: path=/var/run/reboot-required get_md5=no |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import tempfile | |
import os | |
import sphinx.ext.autodoc | |
from textwrap import dedent | |
from types import SimpleNamespace | |
_d = SimpleNamespace(result='') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
def rust_emit_log(*args): | |
# Override from Rust with pyfunction | |
pass | |
class RustLogHandler(logging.Handler): | |
def emit(self, record): | |
msg = f'{record.name}: {record.getMessage()}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
shared lib with safe calls, for std | |
put in Cargo.toml | |
[lib] | |
name = "test" | |
crate-type = [ "cdylib" ] | |
*/ | |
use std::cell::RefCell; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* build with | |
gcc -c -Wall -Werror -fpic -O3 driver.c | |
gcc -shared -o libmydriver.so -O3 driver.o | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
struct Data { | |
char port[20]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use rand::{thread_rng, Rng}; | |
use std::fmt; | |
struct MineField { | |
field: Vec<u16>, | |
x: usize, | |
y: usize, | |
} | |
impl MineField { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[macro_use] | |
extern crate bma_benchmark; | |
use hyper::{client::connect::HttpConnector, Body, Client, Method, Request, StatusCode}; | |
#[tokio::main] | |
async fn main() { | |
let iters = 1_000_000; | |
//let iters = 10; | |
let workers = 4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* [dependencies] | |
tokio = { version = "1.15.0", features = ["full"] } | |
bma-benchmark = "0.0.18" | |
async-nats = "0.10.1" | |
elbus = { version = "", features = ["full"] } | |
*/ | |
#[macro_use] | |
extern crate bma_benchmark; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- drivers/platform/x86/thinkpad_acpi.c.bak 2021-06-28 00:21:11.000000000 +0200 | |
+++ drivers/platform/x86/thinkpad_acpi.c 2022-05-18 04:07:06.814390699 +0200 | |
@@ -8883,31 +8883,22 @@ | |
quirks = tpacpi_check_quirks(fan_quirk_table, | |
ARRAY_SIZE(fan_quirk_table)); | |
- if (gfan_handle) { | |
- /* 570, 600e/x, 770e, 770x */ | |
- fan_status_access_mode = TPACPI_FAN_RD_ACPI_GFAN; | |
- } else { |
OlderNewer