We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ROUTINE ======================== main.isFriend in /home/isucon/webapp/go/app.go 0 6.60s (flat, cum) 43.22% of Total . . 152: checkErr(err) . . 153: return &user . . 154:} . . 155: . . 156:func isFriend(w http.ResponseWriter, r *http.Request, anotherID int) bool { . 200ms 157: session := getSession(w, r) . 10ms 158: id := session.Values["user_id"] . 4.82s 159: row := db.QueryRow(`SELECT COUNT(1) AS cnt FROM relations WHERE (one = ? AND another = ?) OR (one = ? AND another = ?)`, id, anotherID, anotherID, id) . . 160: cnt := new(int) . 1.57s 161: err := row.Scan(cnt) . . 162: checkErr(err) . . 163: return *cnt > 0 . . 164:} . . 165: . . 166:func isFriendAccount(w http.ResponseWriter, r *http.Request, name string) bool {
The text was updated successfully, but these errors were encountered:
Redisによるキャッシュを試したが、あまり効果は出なかった。そもそもMySQLなりRedisなりへのアクセス回数を削減しないとだめそう
Sorry, something went wrong.
次にとれる策
SQLクエリ削減 310d678
Benchmark passed. ❤️ Score: 2379.1000 Success: 2314 Fail: 1 Error: 0 Exception: 0 Redirect: 651
Benchmark passed. ❤️ Score: 2379.1000
標準実装からbranchきったので、約1000点gain
No branches or pull requests
The text was updated successfully, but these errors were encountered: