Skip to content

Instantly share code, notes, and snippets.

@joyeecheung
joyeecheung / index.html
Last active April 13, 2017 06:44
egg benchmark plots
<!DOCTYPE html>
<style>
.axis .domain {
display: none;
}
</style>
<svg width="1200" height="500"></svg>
<script src="https://d3js.org/d3.v4.min.js"></script>
@joyeecheung
joyeecheung / download.sh
Last active November 14, 2017 05:52
Quickly download a repo at a ref without git history, useful if you need multiple tag/commit/branch of it
REF=8680bb9
# The following work as well
# REF=master
# REF=V8.x-staging
# REF=V8.9.1
wget https://github.com/nodejs/node/archive/$REF.tar.gz
mkdir -p $REF
tar zxvf $REF.tar.gz -C $REF --strip-components=1
cd $REF
@joyeecheung
joyeecheung / see-bench.sh
Last active January 25, 2018 18:32
Get the results of Node.js benchmark CI
#/usr/bin/env bash
# Saves CI results to bench-$JOBID.txt
# output of compare.R to bench-$JOBID-results.txt
JOBID=$1
wget https://ci.nodejs.org/job/benchmark-node-micro-benchmarks/$JOBID/consoleText -O bench-$JOBID.txt
grep 'improvement' -A 10000 bench-$JOBID.txt > bench-$JOBID-results.txt
head -n 1 bench-$JOBID-results.txt > bench-$JOBID-significant.txt
grep '*' bench-$JOBID-results.txt >> bench-$JOBID-significant.txt

Recent work

  • Link with lldb reported by llvm-config on MacOS: no need to use the XCode one, can work with custom builds or lldb installed with Homebrew
  • Fixed tests and Travis intergration
  • LLNODE_DEBUG=true to print details of failures during symbol loading, turned on in Travis
  • Loading symbols with shared libraries: can work with libv8 + d8 built with post-mortem support

JS API

  • Original work by @rnchamberlain, rewrote with NAN and some API changes, e.g. use iterators for instance lists to save memory.
@joyeecheung
joyeecheung / build-llnode.sh
Last active December 9, 2019 16:55
Commands to build llnode on throw-away VPS with different UNIX OSs
# I am being lazy here by using the root perm because I am mostly testing
# on throw-away VPS
# Also, might be missing some commands, should be easy to resolve though
# Ubuntu
apt-get update
apt-get install lldb-4.0 git make python g++
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
nvm install stable
git clone --depth=1 -b merge-gyp https://github.com/joyeecheung/llnode.git
@joyeecheung
joyeecheung / hours.js
Created April 8, 2018 07:31
Get frequency of committed time, in UTC hours
'use strict';
const child_process = require('child_process');
const log = child_process.spawnSync('git', ['log', '--format=%cI', '-n', '10000'], {
cwd: process.cwd()
});
const dates = log.stdout.toString().trim();
const hours = dates.split('\n').map(d => new Date(d).getUTCHours());
const map = new Map();
for (const h of hours) {
if (map.has(h)) {
@joyeecheung
joyeecheung / database-2018-06-14.json
Last active June 14, 2018 15:47
CI failures of the last 100 runs in https://ci.nodejs.org/job/node-test-pull-request/, 2018-06-14
[
{
"source": "https://github.com/nodejs/node/pull/21325/",
"upstream": "https://ci.nodejs.org/job/node-test-commit/19231/",
"type": "JS_TEST_FAILURE",
"url": "https://ci.nodejs.org/job/node-test-commit-aix/nodes=aix61-ppc64/15767/console",
"reason": "not ok 1966 parallel/test-worker-dns-terminate\n ---\n duration_ms: 2.829\n severity: crashed\n exitcode: -6\n stack: |-\n ...\n",
"highlight": 0,
"file": "parallel/test-worker-dns-terminate",
"severity": "crashed"
@joyeecheung
joyeecheung / stats-by-pr-count-2018-06-14.json
Created June 14, 2018 15:37
Reasons of CI failure ranked by failed PR count, 2018-06-14
[
{
"count": 14,
"reason": "sequential/test-inspector-port-zero-cluster",
"prs": [
"https://github.com/nodejs/node/pull/21323/",
"https://github.com/nodejs-private/node-private/pull/136/",
"https://github.com/nodejs/node/pull/21196/",
"https://github.com/nodejs/node/pull/21256/",
"https://github.com/nodejs/node/pull/21105/",
[
{
"source": "https://github.com/nodejs/node/pull/21346/",
"upstream": "https://ci.nodejs.org/job/node-test-commit/19271/",
"type": "JS_TEST_FAILURE",
"url": "https://ci.nodejs.org/job/node-test-commit-linux/nodes=centos6-64-gcc48/19594/console",
"reason": "not ok 1550 parallel/test-timers-throw-reschedule\n ---\n duration_ms: 0.349\n severity: fail\n stack: |-\n assert.js:42\n throw new errors.AssertionError({\n ^\n \n AssertionError [ERR_ASSERTION]: false == true\n at Timeout.common.mustCall (/home/iojs/build/workspace/node-test-commit-linux/nodes/centos6-64-gcc48/test/parallel/test-timers-throw-reschedule.js:20:5)\n at Timeout._onTimeout (/home/iojs/build/workspace/node-test-commit-linux/nodes/centos6-64-gcc48/test/common/index.js:478:15)\n at ontimeout (timers.js:498:11)\n at Timer.unrefdHandle (timers.js:611:5)\n ...\n",
"highlight": 0,
"file": "parallel/test-timers-throw-reschedule",
"severity": "fail"
@joyeecheung
joyeecheung / failures.json
Created August 14, 2018 14:34
failures of recent 20 runs, 20180814
[
{
"source": "https://github.com/nodejs/node/pull/22310/",
"upstream": "https://ci.nodejs.org/job/node-test-pull-request/16436/",
"url": "https://ci.nodejs.org/job/node-test-commit-linux/nodes=alpine-latest-x64/20711/console",
"builtOn": "test-softlayer-alpine38_container-x64-1",
"reason": "not ok 775 parallel/test-cluster-master-error\n ---\n duration_ms: 120.106\n severity: fail\n exitcode: -15\n stack: |-\n timeout\n ...\n",
"highlight": 0,
"type": "JS_TEST_FAILURE",
"file": "parallel/test-cluster-master-error",