Skip to content

Instantly share code, notes, and snippets.

@G-WAN
G-WAN / ab.c
Created June 18, 2012 07:06
HTTP server load-testing tool (collecting req/sec, CPU and RAM usage)
// ----------------------------------------------------------------------------
// ab.c is a wrapper for Apache Benchmark, HTTPerf and Weighttp (from Lighttpd)
// ----------------------------------------------------------------------------
// For max speed, build and run ab.c: gcc ab.c -O2 -o abc -lpthread (and ./abc)
// You can also edit & play this program in one step this way: ./gwan -r ab.c
// ============================================================================
// Benchmark framework to test the (free) G-WAN Web App. Server http://gwan.ch/
// See the How-To here: http://gwan.com/en_apachebench_httperf.html
// ----------------------------------------------------------------------------
// 1) invoke Apache Benchmark (IBM), Weighttp (Lighttpd) or HTTPerf (HP) on
@G-WAN
G-WAN / loan.java
Created March 9, 2012 14:53
G-WAN / Java - please help to write Gwan.get_arg() call
// ============================================================================
// Java servlet example for the G-WAN Web App. Server (http://trustleap.ch/)
// ----------------------------------------------------------------------------
// loan.java: G-WAN's version of the Java loan http://gwan.ch/source/loan.jsp
// written for GlassFish (follow the link above for details).
// ----------------------------------------------------------------------------
// This Java code is served very quickly by G-WAN (despite C/Java conversions).
// See below (the " -t 6" option setups 6 client worker threads for 6 Cores):
//
// weighttp -n 1000000 -c 300 -t 6 -k -H "Accept-Encoding: gzip" \
@G-WAN
G-WAN / gwan_json_bench.c
Created March 8, 2012 16:28
G-WAN / JSON parsing and rendering in a C script
// ============================================================================
// C servlet sample for the G-WAN Web Application Server (http://trustleap.ch/)
// ----------------------------------------------------------------------------
// json_bench.c: just parsing json
//
// output:
// On 1 single CPU Core, parsing this JSON tree 100,000 times took 624 ms
// ============================================================================
#include "gwan.h" // G-WAN exported functions
@G-WAN
G-WAN / gwan_bigtable.c
Created March 8, 2012 15:51
G-WAN vs Haskell "Bigtable" test
// ---------------------------------------------------------------------------
// This test is in relation with the "Bigtable" tests done in Haskell:
//
// http://jaspervdj.be/blaze/benchmarks.html
//
// Here is a comparison of Haskell a "high-performance implementation of
// concurrency and parallelism" (according to Wikipedia) to plain old C:
//
// http://shootout.alioth.debian.org/u32/benchmark.php?test=all&lang=ghc&lang2=gcc
//