Skip to content

Instantly share code, notes, and snippets.

View shwei's full-sized avatar

Shang Heng Wei shwei

  • University of California
  • California
View GitHub Profile
@shwei
shwei / fastify 3dc46f3 - tables comparing master vs pass-ip-to-request-constructor branches
Created February 25, 2019 06:31
fastify 3dc46f3 - benchmark master vs pass-ip-to-request-constructor
master:
[1] ┌─────────┬──────┬──────┬────────┬────────┬──────────┬──────────┬───────────┐
[1] │ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │
[1] ├─────────┼──────┼──────┼────────┼────────┼──────────┼──────────┼───────────┤
[1] │ Latency │ 0 ms │ 0 ms │ 131 ms │ 156 ms │ 12.63 ms │ 46.27 ms │ 917.62 ms │
[1] └─────────┴──────┴──────┴────────┴────────┴──────────┴──────────┴───────────┘
[1] ┌───────────┬────────┬────────┬─────────┬────────┬─────────┬─────────┬────────┐
[1] │ Stat │ 1% │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │
[1] ├───────────┼────────┼────────┼─────────┼────────┼─────────┼─────────┼────────┤
[1] │ Req/Sec │ 1800 │ 1800 │ 8991 │ 9751 │ 7515.6 │ 2950.12 │ 1800 │
@shwei
shwei / fastify - master
Last active February 22, 2019 23:05
Benchmark (2019/2/22) between master and pass-ip-to-request-constructor
>$ npm run bench
> fastify@2.0.0-rc.6 bench /Users/shwei/Work/workspace/fastify
> branchcmp -r 2 -g -s "npm run benchmark"
Current Branch is pass-ip-to-request-constructor 88f4c8a
? What's your branches to compare? master, pass-ip-to-request-constructor
? Please enter the command you want to execute in all branches! npm run benchmark
Checking out "master"
Execute "npm run benchmark"
@shwei
shwei / fastify-in-firebase-function.js
Last active July 4, 2021 07:38
Use fastify in firebase function
'use strict';
const functions = require('firebase-functions');
const fastify = require('./fastify');
exports.greetFromFastify = functions.https.onRequest(fastify);
@shwei
shwei / clean-docker-for-mac.sh
Created July 24, 2017 17:58 — forked from MrTrustor/clean-docker-for-mac.sh
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or