Skip to content

Instantly share code, notes, and snippets.

View ymotongpoo's full-sized avatar
📈
observability matters

Yoshi Yamaguchi ymotongpoo

📈
observability matters
View GitHub Profile
Delivered-To: xxxxxxx@xxxxxxxxxxxxxxx
Received: by 10.50.182.129 with SMTP id ee1csp410734igc;
Thu, 21 May 2015 06:03:09 -0700 (PDT)
X-Received: by 10.66.138.15 with SMTP id qm15mr5480439pab.52.1432213389504;
Thu, 21 May 2015 06:03:09 -0700 (PDT)
Return-Path: <m-yamakawa@techno-brain.co.jp>
Received: from smtp.kagoya.net (smtp1.kagoya.net. [153.127.234.3])
by mx.google.com with ESMTP id f3si31666511pdl.5.2015.05.21.06.03.07
for <xxxxxxx@xxxxxxxxxxxxxxx>;
Thu, 21 May 2015 06:03:09 -0700 (PDT)
@ymotongpoo
ymotongpoo / collatz.py
Last active July 7, 2021 15:50
コラッツ予想を1千万まで回してみた
#!/bin/env/python3
def even(x: int) -> int:
return x // 2
def odd(x: int) -> int:
return 3 * x + 1
def collatz(memo: set[int], x: int) -> None:
original = x
@ymotongpoo
ymotongpoo / gtypist_generator.py
Last active September 9, 2020 14:01
A script to generate lesson files for gtypist. Currently generates eucalyn-layout lessons.
import re
import itertools
import collections
import textwrap
import random
import shelve
import contextlib
eucalyn_lessons = [
('it', '', 'home row-first finger', 'ngrams'),
@ymotongpoo
ymotongpoo / go.mod
Last active September 6, 2020 07:23
golang.org/x/text/message sample
module gist.github.com/f6533f5e16a185f348d92f2d4c9b2f05
require golang.org/x/text v0.3.0
@ymotongpoo
ymotongpoo / cut.go
Created September 6, 2019 06:29
pprof特訓会場 演習1
// Copyright 2019 Yoshi Yamaguchi
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@ymotongpoo
ymotongpoo / benchstat
Last active August 23, 2019 07:32
testing.B.ReportMetric
% benchstat bubble.txt selection.txt
name old time/op new time/op delta
Sort-4 29.4ns ± 1% 29.1ns ± 0% -1.00% (p=0.016 n=5+4)
name old compares/op new compares/op delta
Sort-4 15.0 ± 0% 15.0 ± 0% ~ (all equal)
name old alloc/op new alloc/op delta
Sort-4 0.00B 0.00B ~ (all equal)
@ymotongpoo
ymotongpoo / benchstat.txt
Created July 11, 2019 12:27
GoCon Fukuoka 2019 Summer
$ benchstat 556b3f5/benchonly.txt 2cc17bc/benchonly.txt
name old time/op new time/op delta
CodeDecoder-8 13.1ms ± 3% 11.5ms ± 1% -12.36% (p=0.000 n=29+29)
UnicodeDecoder-8 433ns ± 1% 363ns ± 1% -16.09% (p=0.000 n=30+30)
CodeUnmarshalReuse-8 13.0ms ± 1% 11.3ms ± 2% -13.38% (p=0.000 n=27+28)
name old speed new speed delta
CodeDecoder-8 148MB/s ± 3% 169MB/s ± 1% +14.10% (p=0.000 n=29+29)
UnicodeDecoder-8 32.3MB/s ± 1% 38.5MB/s ± 1% +19.20% (p=0.000 n=29+30)