Skip to content

Instantly share code, notes, and snippets.

View summerwind's full-sized avatar
📡

Moto Ishizawa summerwind

📡
View GitHub Profile
@summerwind
summerwind / blocked_frame.md
Created April 11, 2014 14:36
HTTP/2 Issue #362
@summerwind
summerwind / client.js
Last active August 29, 2015 14:08
Sample code for HTTP/2 Conference
var net = require('net'),
hpack = require('./hpack');
var FRAME_HEADER_LEN = 9;
function createSettingsFrame(ack) {
var flag = ack ? 0x1 : 0x0;
var frameHeader = new Buffer(FRAME_HEADER_LEN);
frameHeader.writeUInt32BE(0x0, 0);
@summerwind
summerwind / atf.js
Last active August 29, 2015 14:18
Above the Fold に含まれるリソースの一覧を抽出するスクリプト。
(function(d) {
var resources = {};
var re = /url\(([^)]+)\)/;
// 画面の左下の座標を取得
var maxWidth = window.innerWidth;
var maxHeight = window.innerHeight;
[].forEach.call(d.getElementsByTagName('*'), function(elem) {
var rect = elem.getClientRects()[0];
@summerwind
summerwind / benchmark.md
Last active August 29, 2015 14:19
First Paint Time with HTTP/2 Server Push

HTTP/2 Server Push に関する一考察 (続き)

このスライドで話したことの続き。レンダリングのパフォーマンスを計測するのに DOMContentLoaded は妥当ではない、という話があったので、First Paint による時間を計測する。First Paint については以下のページが詳しい。

計測方法

Chrome の Console 上で以下を実行し、First Paint の時間を計測する。出力される値の単位は秒になる。 サーバーやブラウザといった計測環境はスライドに記載されている環境の通り。

@summerwind
summerwind / spec.md
Last active August 29, 2015 14:23
HTTP/2 extension for HTTP Archive (HAR) 1.2

HTTP/2 extension for HTTP Archive (HAR)

目的

パフォーマンス情報の出力に広く使われている HTTP Archive (HAR) 形式を独自に拡張し、HTTP/2 フレーミングレイヤーの情報を追加できる拡張仕様を検討する。

これは、HTTP/2 ではパフォーマンス面での改善を目的とした様々な機能が盛り込まれているが、既存のブラウザにおいては HTTP/2 のフレーミングレイヤーの情報 (例: HTTP/2 フレームや優先度情報) を取得できないため、パフォーマンスチューニングが難しくなっているためである。

拡張

@summerwind
summerwind / dump.md
Last active September 19, 2015 13:05
H2O のプロセスが暴走する

strace

epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
epoll_wait(4, {{EPOLLERR|EPOLLHUP, {u32=12250816, u64=12250816}}}, 256, 49) = 1
@summerwind
summerwind / huffman.js
Created November 15, 2013 13:35
Example code of Huffman Compression.
// ==============================================
// ハフマン圧縮アルゴリズムの実装
// ==============================================
// ツリーの生成
function create_tree(str) {
// 登場回数を算出
var count = {};
str.split('').forEach(function(word){
if (!(word in count)) {
@summerwind
summerwind / moz_first_paint.js
Last active April 27, 2016 05:27
FirstPaintTime for Firefox
var firstPaint = 0, firstPaintTime, paint;
function paintHandler() {
paint = window.performance.now()
if (firstPaint === 0) {
firstPaint = paint;
firstPaintTime = firstPaint + window.performance.timing.navigationStart;
window.performance.timing.firstPaint = firstPaint;
window.performance.timing.firstPaintTime = firstPaintTime;
}
};
@summerwind
summerwind / README.md
Last active June 22, 2016 01:57
L3DSR Test Client

L3DSR Test Client

This code is tested on Ubuntu 16.04.

Setup

Install scapy.

$ sudo apt-get install scapy
@summerwind
summerwind / keybase.md
Created October 19, 2016 12:28
Keybase proof

Keybase proof

I hereby claim:

  • I am summerwind on github.
  • I am summerwind (https://keybase.io/summerwind) on keybase.
  • I have a public key ASATIxoWXCkM5L81IMSEDYZcOcVMlBNCpH3_qNuQdkes_wo

To claim this, I am signing this object: