Remove first 3 lines of perf list output and join the remaining ones together with ,
alias pl-csv='tail -n+3 | grep -v ^$ | awk '\''{print $1}'\'' | tr "\\n" "," | sed -e s/,$//'
This is specifically tailored to Node.js binding projects in which case the C++ layer is always a library.
Clone gyp:
git clone --depth 1 https://chromium.googlesource.com/external/gyp.git gyp
Add the below common.gypi file in the root of the project.
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | |
| <title>One Graph</title> | |
| <script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script> | |
| <script type="text/javascript" src="simple-graph.js"></script> | |
| <style type="text/css"> | |
| body { font: 13px sans-serif; } | |
| rect { fill: #fff; } |
| (function () { | |
| 'use strict'; | |
| var DEFAULT_MAX_DEPTH = 6; | |
| var DEFAULT_ARRAY_MAX_LENGTH = 50; | |
| var seen; // Same variable used for all stringifications | |
| Date.prototype.toPrunedJSON = Date.prototype.toJSON; | |
| String.prototype.toPrunedJSON = String.prototype.toJSON; |
| # PROMPT=' | |
| # %{$fg[red]%}⌈ %{$fg[white]%}%n%{$fg[red]%} ⌋ %{$fg[blue]%}➤➤➤ %{$fg[red]%}❝ %{$fg[yellow]%}$(get_pwd) %{$fg[red]%}❞ %{$(put_spacing)%}%{$fg[cyan]%}%{$(git_prompt_info)%} | |
| # %{$fg[magenta]%}%i %{$fg[red]%}⚡%{$fg[red]%}%@ %{$fg[red]%}➜ %{$reset_color%}' | |
| PROMPT=' | |
| %{$fg[red]%}⌈ %{$fg[white]%}%n%{$fg[red]%} ⌋ %{$fg[blue]%}➤➤➤ %{$fg[red]%}❝ %{$fg[yellow]%}$(get_pwd) %{$fg[red]%}❞ %{$fg[cyan]%}%{$(git_prompt_info)%} | |
| %{$fg[magenta]%}%i %{$fg[red]%}⚡%{$fg[red]%}%@ %{$fg[red]%}➜ %{$reset_color%}' | |
| function get_pwd() { | |
| echo "${PWD/$HOME/~}" |
| function Y(f) { | |
| var g = function(h) { | |
| return function(x) { | |
| return f(h(h))(x); | |
| }; | |
| }; | |
| return g(g); | |
| } |
| #!/usr/bin/env sh | |
| push=0 | |
| if [[ $# -eq 1 && $1 -eq '-f' ]]; then | |
| push=1 | |
| fi | |
| T1=$(date +%s) | |
| cwd=$(pwd) |
| #!/usr/bin/env sh | |
| repo=$( echo $1 | sed -E 's/^.*\///' | sed -E 's/\.git//' ) | |
| echo "\n<<<<<<<<< Cloning [${repo}] from [${1}] >>>>>>>>>" | |
| T1=$(date +%s) | |
| git clone $1 && cd $repo | |
| HEAD=$( git rev-parse --abbrev-ref HEAD ) |
| (function() { | |
| var CSSCriticalPath = function(w, d, opts) { | |
| var opt = opts || {}; | |
| var css = {}; | |
| var pushCSS = function(r) { | |
| if(!!css[r.selectorText] === false) css[r.selectorText] = {}; | |
| var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/); | |
| for(var i = 0; i < styles.length; i++) { | |
| if(!!styles[i] === false) continue; | |
| var pair = styles[i].split(": "); |