From 15fb75777e23d9e79c7918037702e8d51699db44 Mon Sep 17 00:00:00 2001 From: fujiwara Date: Fri, 24 Nov 2023 20:44:45 +0900 Subject: [PATCH 1/6] =?UTF-8?q?goccy/go-json=E6=9C=80=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bench/isupipe/client_initialize.go | 2 +- bench/isupipe/client_livecomment.go | 2 +- bench/isupipe/client_livestream.go | 2 +- bench/isupipe/client_payment.go | 2 +- bench/isupipe/client_reaction.go | 2 +- bench/isupipe/client_stats.go | 2 +- bench/isupipe/client_top.go | 2 +- bench/isupipe/client_user.go | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bench/isupipe/client_initialize.go b/bench/isupipe/client_initialize.go index 10036e1cd..037dd513a 100644 --- a/bench/isupipe/client_initialize.go +++ b/bench/isupipe/client_initialize.go @@ -2,8 +2,8 @@ package isupipe import ( "context" - "encoding/json" "fmt" + "github.com/goccy/go-json" "io" "net/http" diff --git a/bench/isupipe/client_livecomment.go b/bench/isupipe/client_livecomment.go index 39b488d75..d208aef71 100644 --- a/bench/isupipe/client_livecomment.go +++ b/bench/isupipe/client_livecomment.go @@ -3,8 +3,8 @@ package isupipe import ( "bytes" "context" - "encoding/json" "fmt" + "github.com/goccy/go-json" "io" "net/http" "strconv" diff --git a/bench/isupipe/client_livestream.go b/bench/isupipe/client_livestream.go index 842a0454f..2c32f18d6 100644 --- a/bench/isupipe/client_livestream.go +++ b/bench/isupipe/client_livestream.go @@ -3,8 +3,8 @@ package isupipe import ( "bytes" "context" - "encoding/json" "fmt" + "github.com/goccy/go-json" "io" "net/http" "strconv" diff --git a/bench/isupipe/client_payment.go b/bench/isupipe/client_payment.go index 668124111..2392a9863 100644 --- a/bench/isupipe/client_payment.go +++ b/bench/isupipe/client_payment.go @@ -2,7 +2,7 @@ package isupipe import ( "context" - "encoding/json" + "github.com/goccy/go-json" "io" "net/http" ) diff --git a/bench/isupipe/client_reaction.go b/bench/isupipe/client_reaction.go index fcd4960d1..8b2264dd9 100644 --- a/bench/isupipe/client_reaction.go +++ b/bench/isupipe/client_reaction.go @@ -3,8 +3,8 @@ package isupipe import ( "bytes" "context" - "encoding/json" "fmt" + "github.com/goccy/go-json" "io" "net/http" "strconv" diff --git a/bench/isupipe/client_stats.go b/bench/isupipe/client_stats.go index 148d08a75..f83a910cb 100644 --- a/bench/isupipe/client_stats.go +++ b/bench/isupipe/client_stats.go @@ -2,8 +2,8 @@ package isupipe import ( "context" - "encoding/json" "fmt" + "github.com/goccy/go-json" "io" "net/http" diff --git a/bench/isupipe/client_top.go b/bench/isupipe/client_top.go index 62be51ab7..e1fab1e88 100644 --- a/bench/isupipe/client_top.go +++ b/bench/isupipe/client_top.go @@ -2,8 +2,8 @@ package isupipe import ( "context" - "encoding/json" "fmt" + "github.com/goccy/go-json" "io" "math/rand" "net/http" diff --git a/bench/isupipe/client_user.go b/bench/isupipe/client_user.go index 54d126733..24e01800e 100644 --- a/bench/isupipe/client_user.go +++ b/bench/isupipe/client_user.go @@ -3,8 +3,8 @@ package isupipe import ( "bytes" "context" - "encoding/json" "fmt" + "github.com/goccy/go-json" "io" "net/http" From 179ce645568fe27e37e00f37cd5708838dcaf96b Mon Sep 17 00:00:00 2001 From: fujiwara Date: Fri, 24 Nov 2023 20:45:41 +0900 Subject: [PATCH 2/6] go mod tidy --- bench/go.mod | 1 + bench/go.sum | 2 ++ 2 files changed, 3 insertions(+) diff --git a/bench/go.mod b/bench/go.mod index a65e7e89b..b7a16f9d5 100644 --- a/bench/go.mod +++ b/bench/go.mod @@ -7,6 +7,7 @@ require ( github.com/biogo/store v0.0.0-20201120204734-aad293a2328f github.com/eapache/go-resiliency v1.4.0 github.com/go-playground/validator/v10 v10.16.0 + github.com/goccy/go-json v0.10.2 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/isucon/isucandar v0.0.0-20220322062028-6dd56dc57d72 github.com/miekg/dns v1.1.56 diff --git a/bench/go.sum b/bench/go.sum index 4f14e7cf7..835eea914 100644 --- a/bench/go.sum +++ b/bench/go.sum @@ -25,6 +25,8 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.16.0 h1:x+plE831WK4vaKHO/jpgUGsvLKIqRRkz6M78GuJAfGE= github.com/go-playground/validator/v10 v10.16.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/gorilla/websocket v1.2.0 h1:VJtLvh6VQym50czpZzx07z/kw9EgAxI3x1ZB8taTMQQ= From 89ff453c42ec6766ccfebf8ef54c835b4dec178a Mon Sep 17 00:00:00 2001 From: fujiwara Date: Fri, 24 Nov 2023 20:45:51 +0900 Subject: [PATCH 3/6] =?UTF-8?q?RunViolationChecker=E3=81=AF=E5=81=9C?= =?UTF-8?q?=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 走行中に落とされちゃうので --- bench/cmd/bench/benchmarker.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bench/cmd/bench/benchmarker.go b/bench/cmd/bench/benchmarker.go index 541861898..0b0808df4 100644 --- a/bench/cmd/bench/benchmarker.go +++ b/bench/cmd/bench/benchmarker.go @@ -11,7 +11,6 @@ import ( "github.com/isucon/isucandar/agent" "github.com/isucon/isucandar/score" - "github.com/isucon/isucon13/bench/internal/bencherror" "github.com/isucon/isucon13/bench/internal/benchscore" "github.com/isucon/isucon13/bench/internal/config" "github.com/isucon/isucon13/bench/internal/scheduler" @@ -352,7 +351,7 @@ func (b *benchmarker) run(ctx context.Context) error { b.runClientProviders(ctx) - violateCh := bencherror.RunViolationChecker(ctx) + violateCh := make(chan error) // とめておく bencherror.RunViolationChecker(ctx) loadAttackHTTPClient := b.loadAttackHTTPClient() // FIXME: LIMITは負荷をみて調整したい From b1e36861cf79f060e1da5458e451bddad07cff57 Mon Sep 17 00:00:00 2001 From: fujiwara Date: Fri, 24 Nov 2023 22:41:25 +0900 Subject: [PATCH 4/6] =?UTF-8?q?icon=E5=8F=96=E5=BE=97=E3=82=92=E6=9C=80?= =?UTF-8?q?=E5=A4=A710=E5=80=8B=E3=81=BE=E3=81=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bench/scenario/viewer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bench/scenario/viewer.go b/bench/scenario/viewer.go index 9f49a899b..c8ab1cf35 100644 --- a/bench/scenario/viewer.go +++ b/bench/scenario/viewer.go @@ -93,9 +93,12 @@ func BasicViewerScenario( lgr.Warnf("view: failed to get livecomments: %s\n", err.Error()) continue } else { - for _, comment := range comments { + for i, comment := range comments { client.GetIcon(ctx, comment.User.Name, isupipe.WithETag(comment.User.IconHash)) // icon取得はエラーになっても気にしない + if i > 10 { // 全部取ると多すぎるので10件まで + break + } } } From 18ed9ce0da54a25d7a85190b5f6f418a403055a5 Mon Sep 17 00:00:00 2001 From: fujiwara Date: Fri, 24 Nov 2023 22:58:39 +0900 Subject: [PATCH 5/6] =?UTF-8?q?PHP=E3=81=A8Python=E3=81=A7=E3=81=AA?= =?UTF-8?q?=E3=82=93=E3=81=8B=E3=81=93=E3=81=91=E3=82=8B=E3=81=AE=E3=81=A7?= =?UTF-8?q?=20Revert=20"goccy/go-json=E6=9C=80=E9=AB=98"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 15fb75777e23d9e79c7918037702e8d51699db44. --- bench/isupipe/client_initialize.go | 2 +- bench/isupipe/client_livecomment.go | 2 +- bench/isupipe/client_livestream.go | 2 +- bench/isupipe/client_payment.go | 2 +- bench/isupipe/client_reaction.go | 2 +- bench/isupipe/client_stats.go | 2 +- bench/isupipe/client_top.go | 2 +- bench/isupipe/client_user.go | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bench/isupipe/client_initialize.go b/bench/isupipe/client_initialize.go index 037dd513a..10036e1cd 100644 --- a/bench/isupipe/client_initialize.go +++ b/bench/isupipe/client_initialize.go @@ -2,8 +2,8 @@ package isupipe import ( "context" + "encoding/json" "fmt" - "github.com/goccy/go-json" "io" "net/http" diff --git a/bench/isupipe/client_livecomment.go b/bench/isupipe/client_livecomment.go index d208aef71..39b488d75 100644 --- a/bench/isupipe/client_livecomment.go +++ b/bench/isupipe/client_livecomment.go @@ -3,8 +3,8 @@ package isupipe import ( "bytes" "context" + "encoding/json" "fmt" - "github.com/goccy/go-json" "io" "net/http" "strconv" diff --git a/bench/isupipe/client_livestream.go b/bench/isupipe/client_livestream.go index 2c32f18d6..842a0454f 100644 --- a/bench/isupipe/client_livestream.go +++ b/bench/isupipe/client_livestream.go @@ -3,8 +3,8 @@ package isupipe import ( "bytes" "context" + "encoding/json" "fmt" - "github.com/goccy/go-json" "io" "net/http" "strconv" diff --git a/bench/isupipe/client_payment.go b/bench/isupipe/client_payment.go index 2392a9863..668124111 100644 --- a/bench/isupipe/client_payment.go +++ b/bench/isupipe/client_payment.go @@ -2,7 +2,7 @@ package isupipe import ( "context" - "github.com/goccy/go-json" + "encoding/json" "io" "net/http" ) diff --git a/bench/isupipe/client_reaction.go b/bench/isupipe/client_reaction.go index 8b2264dd9..fcd4960d1 100644 --- a/bench/isupipe/client_reaction.go +++ b/bench/isupipe/client_reaction.go @@ -3,8 +3,8 @@ package isupipe import ( "bytes" "context" + "encoding/json" "fmt" - "github.com/goccy/go-json" "io" "net/http" "strconv" diff --git a/bench/isupipe/client_stats.go b/bench/isupipe/client_stats.go index f83a910cb..148d08a75 100644 --- a/bench/isupipe/client_stats.go +++ b/bench/isupipe/client_stats.go @@ -2,8 +2,8 @@ package isupipe import ( "context" + "encoding/json" "fmt" - "github.com/goccy/go-json" "io" "net/http" diff --git a/bench/isupipe/client_top.go b/bench/isupipe/client_top.go index e1fab1e88..62be51ab7 100644 --- a/bench/isupipe/client_top.go +++ b/bench/isupipe/client_top.go @@ -2,8 +2,8 @@ package isupipe import ( "context" + "encoding/json" "fmt" - "github.com/goccy/go-json" "io" "math/rand" "net/http" diff --git a/bench/isupipe/client_user.go b/bench/isupipe/client_user.go index 24e01800e..54d126733 100644 --- a/bench/isupipe/client_user.go +++ b/bench/isupipe/client_user.go @@ -3,8 +3,8 @@ package isupipe import ( "bytes" "context" + "encoding/json" "fmt" - "github.com/goccy/go-json" "io" "net/http" From d366cf7c237c25ce78c8610519e77836be6deeb8 Mon Sep 17 00:00:00 2001 From: fujiwara Date: Fri, 24 Nov 2023 22:59:11 +0900 Subject: [PATCH 6/6] go mod tidy --- bench/go.mod | 1 - bench/go.sum | 2 -- 2 files changed, 3 deletions(-) diff --git a/bench/go.mod b/bench/go.mod index b7a16f9d5..a65e7e89b 100644 --- a/bench/go.mod +++ b/bench/go.mod @@ -7,7 +7,6 @@ require ( github.com/biogo/store v0.0.0-20201120204734-aad293a2328f github.com/eapache/go-resiliency v1.4.0 github.com/go-playground/validator/v10 v10.16.0 - github.com/goccy/go-json v0.10.2 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/isucon/isucandar v0.0.0-20220322062028-6dd56dc57d72 github.com/miekg/dns v1.1.56 diff --git a/bench/go.sum b/bench/go.sum index 835eea914..4f14e7cf7 100644 --- a/bench/go.sum +++ b/bench/go.sum @@ -25,8 +25,6 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.16.0 h1:x+plE831WK4vaKHO/jpgUGsvLKIqRRkz6M78GuJAfGE= github.com/go-playground/validator/v10 v10.16.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= -github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= -github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/gorilla/websocket v1.2.0 h1:VJtLvh6VQym50czpZzx07z/kw9EgAxI3x1ZB8taTMQQ=