Skip to content

Instantly share code, notes, and snippets.

View mmarchini's full-sized avatar
🛑
taking a break

mary marchini mmarchini

🛑
taking a break
View GitHub Profile
@mmarchini
mmarchini / v8-heap-snapshot-schema.md
Last active March 10, 2020 14:12
V8 Heap Snapshot Schema

V8 Heap Snapshot Schema

Key Description
snapshot Metadata from the snapshot. See snapshot
nodes List of heap nodes. See nodes
edges List of heap edges between nodes. See edges
trace_function_infos ???
trace_tree ???
@mmarchini
mmarchini / chrome-devtools-heapsnapshot-Loading-benchmark.md
Last active January 4, 2018 19:11
Chrome DevTools Heap Snapshot Loading Benchmark

Chrome DevTools Heap Snapshot Loading Benchmark

Benchmark of the Chrome DevTools to determine if it can load large Heap Snapshots. Specs of the environment used are available at Environment Specs.

Results

Time to Load is an approximate value, as there's no way (that I'm aware of) to measure the loading time of a heap snapshot in Chrome DevTools.

@mmarchini
mmarchini / README.md
Last active January 22, 2018 19:41
Node v6.x runtime --perf-basic-prof toggling

Node v6.x runtime --perf-basic-prof toggling

Builds

Linux x86: node-v6.12.3

Linux x64: node-v6.12.3

Docker apline image: docker pull sthima/node-custom-build:toggle-perf-basic-prof (Dockerfile)

v8-version,6,1,534,48,0
shared-library,"/usr/bin/node",0x00400000,0x01fa2000,0
shared-library,"/lib/x86_64-linux-gnu/libc-2.26.so",0x7f8a84f0c000,0x7f8a850e2000,0
shared-library,"/lib/x86_64-linux-gnu/libpthread-2.26.so",0x7f8a852ec000,0x7f8a85306000,0
shared-library,"/lib/x86_64-linux-gnu/libgcc_s.so.1",0x7f8a8550b000,0x7f8a85521000,0
shared-library,"/lib/x86_64-linux-gnu/libm-2.26.so",0x7f8a85722000,0x7f8a85877000,0
shared-library,"/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24",0x7f8a85a78000,0x7f8a85bf0000,0
shared-library,"/lib/x86_64-linux-gnu/librt-2.26.so",0x7f8a85dfe000,0x7f8a85e05000,0
shared-library,"/lib/x86_64-linux-gnu/libdl-2.26.so",0x7f8a86006000,0x7f8a86009000,0
shared-library,"/lib/x86_64-linux-gnu/ld-2.26.so",0x7f8a8620a000,0x7f8a86231000,0
@mmarchini
mmarchini / README.md
Created March 5, 2018 14:40
Benchmark results for mmarchini/node@hack-the-stack
$ node benchmark/compare.js --old ./node-master --new ./node-hack-the-stack http > compare-hack-the-stack.http.csv
$ cat compare-hack-the-stack.http.csv  | Rscript benchmark/compare.R
                                                                                                confidence improvement accuracy (*)    (**)   (***)
 http/bench-parser.js n=100000 len=16                                                                          -1.17 %       ±3.73%  ±4.96%  ±6.46%
 http/bench-parser.js n=100000 len=32                                                                          -1.55 %       ±3.19%  ±4.24%  ±5.52%
 http/bench-parser.js n=100000 len=4                                                                           -2.90 %       ±4.20%  ±5.59%  ±7.27%
 http/bench-parser.js n=100000 len=8                                                                           -2.39 %       ±3.41%  ±4.54%  ±5.91%
 http/check_invalid_header_char.js n=1000000 input=''                                       
@mmarchini
mmarchini / my.zsh-theme
Created March 27, 2018 18:30
My ZSH theme, inspired on lambda-gister and lambda-mod
#!/usr/bin/env zsh
local LAMBDA="%(?,%{$fg_bold[green]%}λ,%{$fg_bold[red]%}λ)"
function get_pwd(){
git_root=$PWD
while [[ $git_root != / && ! -e $git_root/.git ]]; do
git_root=$git_root:h
done
if [[ $git_root = / ]]; then
@mmarchini
mmarchini / index.js
Created June 15, 2018 23:29
Taming the Dragon example
'use strict';
const http = require('http');
const port = 3000;
class Visit {
constructor(visit_id, headers) {
this.visit_id = visit_id;
this.headers = headers;
}
@mmarchini
mmarchini / debugger.cc
Last active September 3, 2018 14:49
V8 Postmortem API Usage Example
#include <v8.h>
#include <v8-postmortem.h>
#include <napi.h>
#include <lldb/API/SBDebugger.h>
#include <lldb/API/SBTarget.h>
#include <lldb/API/SBProcess.h>
#include <iostream>
using lldb::addr_t;
@mmarchini
mmarchini / README.md
Last active October 17, 2018 17:41
State of Postmortem with Promises in Node.js

Goals

When a promise is rejected with no catch handler attached, it should:

  • Aborting with error code for unhandled rejection to generate core-dump
  • Get stack trace from the point where the error was thrown
  • Inspecting arguments, closures and variables

Current State

@mmarchini
mmarchini / lldb-diagnose-undiwnd-output
Last active October 3, 2019 05:24
llnode weird <adaptor> stack behavior on Node.js v12
(lldb) target create "/home/mmarchini/.nvm/versions/node/v12.3.0/bin/node" --core "core.frame-scenario.1"
Core file '/home/mmarchini/workspace/nodejs/llnode/core.frame-scenario.1' (x86_64) was loaded.
(lldb) plugin load '/home/mmarchini/workspace/nodejs/llnode/llnode.so'
(lldb) settings set prompt '(llnode) '
(llnode) command script import diagnose_unwind
bind: Invalid command `enable-meta-key'.
The "diagnose-unwind" command has been installed, type "help diagnose-unwind" for detailed help.
(llnode) diagnose-unwind
LLDB version lldb version 6.0.1
Unwind diagnostics for thread 1