Skip to content

Instantly share code, notes, and snippets.

OWenT owt5008137

Block or report user

Report or block owt5008137

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@owt5008137
owt5008137 / README.md
Last active Apr 22, 2020
C++20 Coroutine jump
View README.md

Clang C++20 Coroutine ASM

编译

# Linux
/data/prebuilt/load-llvm-envs.sh clang++ -std=c++2a -O2 -g -ggdb -stdlib=libc++ -fcoroutines-ts -lc++ -lc++abi test-coroutine.cpp -o test-coroutine
./test-coroutine
@owt5008137
owt5008137 / README.md
Last active May 26, 2020
coroutine benckmark
View README.md

Benchmark Data

2019-09-29 更新一版运行结果,增加 C++20 Coroutine 测试结果

组件(Avg) 协程数:1 切换开销 协程数:1000 创建开销 协程数:1000 切换开销 协程数:30000 创建开销 协程数:30000 切换开销
栈大小(如果可指定) 16 KB 2 MB 2 MB 64 KB 64 KB
C++20 Coroutine - Clang 5 ns 130 ns 6 ns 136 ns 9 ns
C++20 Coroutine - MSVC 10 ns 407 ns 14 ns 369 ns 28 ns
[libcopp][1] 77 ns 4.1 us 105 ns 3.8 us 273 ns
@owt5008137
owt5008137 / README.md
Created Mar 8, 2018
libwebsockets+libuv最小化sample
View README.md

编译脚本:

g++ *.cpp -o test.exe -O0 -g -ggdb -std=c++11 -Wall         \
     /mnt/d/workspace/prebuilt/wsl/libuv/lib/libuv.a        \
     -I/mnt/d/workspace/prebuilt/wsl/libuv/include          \
     -I/mnt/d/workspace/prebuilt/wsl/libwebsockets/include  \
     -L/lib/x86_64-linux-gnu                                \
     -L/mnt/d/workspace/prebuilt/wsl/libuv/lib              \
     -L/mnt/d/workspace/prebuilt/wsl/libwebsockets/lib      \
View test_backtrace.cpp
/**
* traceback for cpp
*
* Created on: 2018-01-27
* Author: owent
*
* Released under the MIT license
*
* @note Required flag -rdynamic or addr2line to get the function name when using gcc/clang in unix like system
* @note Using addr2line -Cfpe <exe_path> [func_addr...] for more detail when using gcc/clang
View goroutine_benchmark.go
package main
import (
"fmt"
"os"
"strconv"
"time"
)
func runCallback(in, out chan int64) {
@owt5008137
owt5008137 / output fot test4
Created May 20, 2017
VC和GCC成员函数指针实现的研究
View output fot test4
# g++ test4.cpp -g -ggdb -O0 -o test4 && ./test4
# gcc version: 5.4.0 (Ubuntu 16.04 LTS)
word size = 8
sizeof vptr = 16
info:15
info:31
info:44
info:44
print:35
@owt5008137
owt5008137 / compile command.sh
Created May 15, 2017
boost.context.callcc.benchmark
View compile command.sh
#!/bin/bash
# we assume boost (1.64 and upper) is installed in $BOOST_PREBUILT
BOOST_LIB_DIR=$BOOST_PREBUILT/lib;
g++ context_cc_text.cpp -O2 -g -ggdb -I$BOOST_PREBUILT/include -L$BOOST_LIB_DIR \
-lboost_context -lboost_system -lboost_thread -lboost_chrono \
-std=c++11 -o context_cc_text
View Atom-Editor-Settings.md

用于同步Atom编辑器的个人偏好配置

@owt5008137
owt5008137 / benchmark-zeromq.md
Last active Dec 22, 2018
zeromq 集群模型压力测试
View benchmark-zeromq.md

README

proxyd进程

proxyd有一个接受endpoint,并会监听一个内部地址和一个外部地址

内部地址用于连接本机的serverd,外部地址用于和其他集群的proxyd通信

proxyd对内部serverd发送消息采用zmq router节点,对每个外部proxyd都会建立一个zmq dealer节点与之通信

@owt5008137
owt5008137 / lnmp.sh
Last active Aug 29, 2015
Lnmp yum 安装脚本 (for CentOS)
View lnmp.sh
#!/bin/sh
WORKING_DIR="$PWD";
ARCH_FLAG=$(getconf LONG_BIT);
PHP_CONF_FILE_PATH=/etc/php.ini
PHP_CONF_DIR_PATH=/etc/php.d
PHP_FPM_CONF_FILE_PATH=/etc/php-fpm.d/www.conf
PHP_CACHE_DIR_PATH=/tmp/php/cache
PHP_EXT_LOG_DIR_PATH=/var/log/php
You can’t perform that action at this time.