Skip to content

Instantly share code, notes, and snippets.

@iefserge
iefserge / runtime-http-server.js
Last active September 13, 2015 17:36
runtime-http-server.js
'use strict';
const runtime = require('runtimejs');
const HttpResponse = require('eshttp').HttpResponse;
const HttpServer = require('eshttp').HttpServer;
const server = new HttpServer();
const response = new HttpResponse(200, { server: 'runtimejs' }, 'Hello World!');
server.onrequest = request => {
#!ipxe
kernel /runtime
initrd /initrd
boot
$ runtime-qemu ./initrd
--- starting qemu ---
[INITRD] Load /bundle.js len 236291
v0.1.13 kernel (v8 4.5.107)
v0.1.23 core library
loading...
Hello World!
# install dependencies
npm install runtimejs
npm install runtimeify -g
npm install runtime-tools -g
# bundle up ramdisk image
runtimeify index.js -o initrd
# make sure you have QEMU installed
brew install qemu # OSX
var runtime = require('runtimejs')
console.log('Hello world!')
@iefserge
iefserge / 1.sh
Created June 27, 2015 17:07
runtime.js 0.1.17
$ ab -c 100 -n 1000 http://192.168.1.176:9000/
This is ApacheBench, Version 2.3 <$Revision: 1638069 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.1.176 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
@iefserge
iefserge / pr.md
Last active August 29, 2015 14:23 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@iefserge
iefserge / gist:4da005c69db091a8c492
Created June 21, 2015 21:14
runtime.js 100k requests over local network results
$ ab -c 10 -n 100000 http://192.168.1.176:9000/
This is ApacheBench, Version 2.3 <$Revision: 1604373 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 192.168.1.176 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
[deoptimizing (DEOPT soft): begin 0x8000984a39 <JS Function isNaN (SharedFunctionInfo 0x800093e459)> (opt #5) @1, FP to SP delta: 24]
translating isNaN => node=24, height=8
0x20005ff858: [top + 48] <- 0x8000904161 ; [sp + 48] 0x8000904161 <undefined>
0x20005ff850: [top + 40] <- 0x80030bd0a1 ; rax 0x80030bd0a1 <Number: g>
0x20005ff848: [top + 32] <- 0x800671e57c ; caller's pc
0x20005ff840: [top + 24] <- 0x20005ff890 ; caller's fp
0x20005ff838: [top + 16] <- 0x800097b0f9 ; [sp + 0] 0x800097b0f9 <FixedArray[41]>
0x20005ff838: [top + 16] <- 0x800097b0f9; context
0x20005ff830: [top + 8] <- 0x8000984a39; function
0x20005ff828: [top + 0] <- 0x80009041f9 ; rbx 0x80009041f9 <true>
@iefserge
iefserge / gist:feb7c32ff5c0405498b8
Created October 31, 2014 14:06
cat ~/.megafunnel/head2014-10-28T18:18:20.079Z.log
1414520452734,condor,2.0.0,load,1280,701,0,0,http://127.0.0.1:4001/,17,"Tue, 28 Oct 2014 18:20:51 GMT",-120,,,,,,,,,,,ZJ8n-4N9B,1
1414520452735,condor,2.0.0,visibility,1280,701,0,0,http://127.0.0.1:4001/,0,"Tue, 28 Oct 2014 18:20:51 GMT",-120,,,,,,,visible,,,,ZJ8n-4N9B,1
1414520454976,condor,2.0.0,visibility,1280,701,0,0,http://127.0.0.1:4001/,2274,"Tue, 28 Oct 2014 18:20:53 GMT",-120,,,,,,,hidden,,,,ZJ8n-4N9B,1
1414520456598,condor,2.0.0,end,1280,701,0,0,http://127.0.0.1:4001/,4899,"Tue, 28 Oct 2014 18:20:56 GMT",-120,,,,,,,,,,,ZJ8n-4N9B,1
1414520744705,condor,2.0.0,load,1280,701,0,0,file:///Users/serge/opt/mic/index.html,2,"Tue, 28 Oct 2014 18:25:43 GMT",-120,,,,,,,,,,,Z1Cz6NNqB,1
1414520744706,condor,2.0.0,visibility,1280,701,0,0,file:///Users/serge/opt/mic/index.html,0,"Tue, 28 Oct 2014 18:25:43 GMT",-120,,,,,,,visible,,,,Z1gCMaEV9S,1
1414520748030,condor,2.0.0,visibility,1280,479,0,0,file:///Users/serge/opt/mic/index.html,2962,"Tue, 28 Oct 2014 18:25:46 GMT",-120,,,,,,,hidden,,,,ZyjEpV45r,1
1414520748031