元記事: https://www.industrialempathy.com/posts/design-docs-at-google/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"bytes" | |
"crypto/tls" | |
"fmt" | |
"io" | |
"log" | |
"net" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark/ips' | |
require 'benchmark/memory' | |
module Benchmarker | |
class Target | |
attr_reader :title, :code_block | |
def initialize(title:, code_block:) | |
@title = title | |
@code_block = code_block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name old time/op new time/op delta | |
pkg:github.com/goldeneggg/structil goos:linux goarch:amd64 | |
NewGetter_Val 690ns ± 6% 568ns ± 0% -17.66% (p=0.008 n=5+5) | |
NewGetter_Val-2 737ns ± 2% 584ns ± 4% -20.82% (p=0.016 n=5+4) | |
NewGetter_Ptr 556ns ± 3% 391ns ± 1% -29.62% (p=0.008 n=5+5) | |
NewGetter_Ptr-2 616ns ±11% 443ns ± 4% -28.15% (p=0.008 n=5+5) | |
GetterGetType_String 24.4ns ± 3% 13.6ns ± 0% -44.15% (p=0.008 n=5+5) | |
GetterGetType_String-2 24.2ns ± 2% 13.7ns ± 0% -43.53% (p=0.008 n=5+5) | |
GetterGetValue_String 24.4ns ± 6% 13.9ns ± 0% -43.12% (p=0.008 n=5+5) | |
GetterGetValue_String-2 24.5ns ± 3% 13.9ns ± 0% -43.23% (p=0.016 n=5+4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark/ips' | |
require 'benchmark/memory' | |
class Hoge | |
class << self | |
DEFAULT_TIME = 5 | |
DEFAULT_WARMUP = 2 | |
def ips(title:, | |
time: DEFAULT_TIME, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name old time/op new time/op delta | |
pkg:github.com/goldeneggg/structil goos:linux goarch:amd64 | |
NewFinder_Val 831ns ± 2% 971ns ± 4% +16.84% (p=0.008 n=5+5) | |
NewFinder_Val-2 831ns ± 5% 931ns ± 9% +11.98% (p=0.008 n=5+5) | |
NewFinder_Ptr 738ns ± 3% 779ns ± 1% +5.53% (p=0.008 n=5+5) | |
NewFinder_Ptr-2 778ns ± 6% 813ns ±12% ~ (p=0.421 n=5+5) | |
ToMap_1FindOnly 437ns ± 3% 405ns ± 3% -7.41% (p=0.008 n=5+5) | |
ToMap_1FindOnly-2 430ns ± 4% 426ns ± 6% ~ (p=0.587 n=5+5) | |
ToMap_2FindOnly 541ns ± 2% 574ns ± 4% +6.10% (p=0.008 n=5+5) | |
ToMap_2FindOnly-2 559ns ± 4% 580ns ± 2% ~ (p=0.103 n=5+5) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func Print(type T)(s []T) { | |
for _, v := range s { | |
fmt.Println(v) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- '**/*.md' | |
- 'LICENSE' | |
pull_request: | |
paths-ignore: | |
- '**/*.md' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.7" | |
services: | |
db: | |
image: mysql:8.0.20 | |
command: --default-authentication-plugin=mysql_native_password | |
environment: | |
- MYSQL_ROOT_PASSWORD | |
- MYSQL_ALLOW_EMPTY_PASSWORD | |
volumes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG ARG_RUBY_VERSION | |
FROM ruby:${ARG_RUBY_VERSION}-alpine3.11 | |
# hadolint ignore=DL3008,DL3018 | |
RUN apk update && \ | |
apk add --update --no-cache \ | |
build-base \ | |
bash \ | |
curl \ |
NewerOlder