Skip to content

Instantly share code, notes, and snippets.

View losfair's full-sized avatar

Heyang Zhou losfair

View GitHub Profile
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
static __attribute__((constructor)) void hook_init(void) {
int fd,len,i;
char *cmdline;
cmdline=malloc(65536);
@losfair
losfair / IceNodeBenchmarkResults.txt
Created July 18, 2017 11:21
Ice-node Benchmark Results
$ ab -n 200000 -c 1000 http://127.0.0.1:1122/hello_world
This is ApacheBench, Version 2.3 <$Revision: 1706008 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 20000 requests
Completed 40000 requests
Completed 60000 requests
Completed 80000 requests
@losfair
losfair / IceNodeApplicationBenchmarkResult.txt
Created July 20, 2017 05:42
IceNodeApplicationBenchmarkResult
Ice-node:
Target: http://127.0.0.1:6001
Threads: 100
Target: http://127.0.0.1:6001
Threads: 100
Target: http://127.0.0.1:6001
Threads: 100
Target: http://127.0.0.1:6001
Threads: 100
@losfair
losfair / benchmarks.md
Created August 1, 2018 08:30
WebAssembly VM Benchmarks
@losfair
losfair / coroutine.c
Created January 14, 2019 14:02
Coroutines: Lightweight Threads for Concurrency - Example code
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
asm(
"_co_switch:\n"
"push %rbx\n"
"push %rbp\n"
"push %r12\n"
"push %r13\n"
use backtrace::Backtrace;
use std::{mem, ptr};
#[inline(never)]
fn f(x: i32) -> i32 {
if x == 0 || x == 1 {
1
} else {
f(x - 1) + f(x - 2)
}