Skip to content

Instantly share code, notes, and snippets.

View youngsofun's full-sized avatar

Yang Xiufeng youngsofun

View GitHub Profile
i32/i32(not_nullable)_index/1024
time: [11.613 us 11.723 us 11.853 us]
i32/i32(not_nullable)_embedded/1024
time: [5.8348 us 5.8626 us 5.8950 us]
i32/i32(null=0.1)_index/1024
time: [24.171 us 24.240 us 24.306 us]
i32/i32(null=0.1)_embedded/1024
time: [7.7596 us 7.8194 us 7.8801 us]
i32/i32(not_nullable)_index/4096
time: [63.921 us 64.138 us 64.359 us]
i32/i32(not_nullable)_index/1024
time: [6.3496 us 6.3972 us 6.4527 us]
i32/i32(not_nullable)_iter/1024
time: [9.6259 us 9.6401 us 9.6539 us]
i32/i32(not_nullable)_embedded/1024
time: [5.7407 us 5.7561 us 5.7744 us]
i32/i32(null=0.1)_index/1024
time: [16.691 us 17.875 us 19.172 us]
i32/i32(null=0.1)_iter/1024
time: [9.6384 us 9.6540 us 9.6710 us]
i32/i32(not_nullable)_index/1024
time: [6.4958 us 6.5192 us 6.5482 us]
i32/i32(not_nullable)_iter/1024
time: [9.6903 us 9.7052 us 9.7230 us]
i32/i32(null=0.1)_index/1024
time: [14.690 us 14.821 us 14.965 us]
i32/i32(null=0.1)_iter/1024
time: [9.6540 us 9.6848 us 9.7183 us]
i32/i32(not_nullable)_index/4096
@youngsofun
youngsofun / bench int32 not null
Last active May 20, 2022 14:26
csv: index vs iterator
[6.0826 us 6.1268 us 6.1724 us] 2^10 write_by_row
[9.5422 us 9.6044 us 9.7021 us] write_iterator
[34.306 us 35.018 us 35.743 us] 2^12
[59.263 us 64.474 us 70.274 us]
[258.79 us 274.87 us 292.75 us] 2^14
[268.50 us 299.75 us 336.83 us]
[1.0222 ms 1.0915 ms 1.1700 ms] 2^16
fn write_stream(col: &ColumnRef) {
let mut buf = Vec::with_capacity(1000*1000);
let s = col.data_type().create_serializer();
let mut stream = s.serialize_csv(&col, &FormatSettings::default()).unwrap();
while let Some(field) = stream.next() {
buf.extend_from_slice(field);
buf.push(b',');
}
@youngsofun
youngsofun / custom_iterator.cpp
Created April 2, 2020 06:47 — forked from jeetsukumaran/custom_iterator.cpp
Sample C++/STL custom iterator
// Sample custom iterator.
// By perfectly.insane (http://www.dreamincode.net/forums/index.php?showuser=76558)
// From: http://www.dreamincode.net/forums/index.php?showtopic=58468
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <cassert>
(py3) yxf-mac ➜ docs git:(master) ✗ sphinx-quickstart
Welcome to the Sphinx 1.7.5 quickstart utility.
Please enter values for the following settings (just press Enter to
accept a default value, if one is given in brackets).
Selected root path: .
You have two options for placing the build directory for Sphinx output.
@youngsofun
youngsofun / Git push deployment in 7 easy steps.md
Created June 25, 2018 04:49 — forked from thomasfr/Git push deployment in 7 easy steps.md
7 easy steps to automated git push deployments. With small and configurable bash only post-receive hook
@youngsofun
youngsofun / insert_guard.vim
Created May 12, 2018 00:40 — forked from yt-siden/insert_guard.vim
Insert UUID-based include guard macro on VIM
" C/C++ insert UUID based include guard
function! s:insert_include_guard()
let s:uuid=system('uuidgen')
let s:uuid=strpart(s:uuid, 0, strlen(s:uuid)-1)
let s:uuid=substitute(s:uuid, '[a-f]', '\u\0', 'g')
let s:uuid=substitute(s:uuid, '\-', '_', 'g')
let s:uuid='UUID_'.s:uuid
call append(0, '#ifndef '.s:uuid)
call append(1, '#define '.s:uuid)
import threading
import psutil
import time
N = 1000
S = 0.01
a = list(range(N))
stop = True