- JSON is faster for small size data
- map (key size < 50 and Unmarshalling intensive workload)
- single struct
- gob is faster for big size data
- map (key size > 50 or Marshalling intensive workload)
- slice
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
#!/bin/bash | |
OS_KEY_REPEAT=2 | |
OS_REPEAT_START=15 | |
# keyboard | |
defaults write NSGlobalDomain KeyRepeat -int $OS_KEY_REPEAT # キーリピート速度 | |
defaults write NSGlobalDomain InitialKeyRepeat -int $OS_REPEAT_START # キーリピート開始までの時間 | |
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false # キー代用入力を無効にする |
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 bench | |
import ( | |
"strconv" | |
"testing" | |
) | |
var smallStr = "35" | |
var bigStr = "999999999999999" |
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
1122334455667788A | |
AABBCCDDEEFFGGHH1 |
Goでよくやってしまうミスが3つあります。
私はそのミスを、分かりやすいように簡略した書き方ではなく、巷でよく見かける書き方のままここで説明します。
3つのミスの全てが、私の知る限り少なくとも1回づつ、Kubernetesの過去のコードレビューにありました。
1: ループ変数がループ外のスコープになっている
この各行はいったい何を行っているのでしょうか。想像してから下へスクロールしてください。
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 library | |
import ( | |
"bytes" | |
"image" | |
"image/jpeg" | |
"io" | |
"github.com/disintegration/imaging" | |
) |
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
class Action { | |
constructor(req, res){ | |
this.request = req; | |
this.response = res; | |
this.requestSource = (req.body.originalRequest) ? req.body.originalRequest.source : undefined; | |
this.app = new DialogflowApp({req, res}); | |
console.log('api-v2') | |
} |
NewerOlder