Skip to content

Commit

Permalink
goccy/go-jsonに変更 52453
Browse files Browse the repository at this point in the history
  • Loading branch information
シン・ウー馬場ーイー2 committed Aug 27, 2022
1 parent 4edc723 commit bfe8218
Show file tree
Hide file tree
Showing 7 changed files with 1,487 additions and 1,482 deletions.
1 change: 1 addition & 0 deletions home/isucon/webapp/go/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
)

require (
github.com/goccy/go-json v0.9.11 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/labstack/gommon v0.3.1 // indirect
github.com/mattn/go-colorable v0.1.11 // indirect
Expand Down
2 changes: 2 additions & 0 deletions home/isucon/webapp/go/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk=
github.com/goccy/go-json v0.9.11/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/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
Expand Down
Binary file modified home/isucon/webapp/go/isuconquest
Binary file not shown.
6 changes: 4 additions & 2 deletions home/isucon/webapp/go/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package main

import (
"database/sql"
"encoding/json"
"fmt"
"io"
"math"
Expand All @@ -14,6 +13,7 @@ import (
"time"

"github.com/go-sql-driver/mysql"
"github.com/goccy/go-json"
"github.com/google/uuid"
"github.com/jmoiron/sqlx"
"github.com/labstack/echo/v4"
Expand Down Expand Up @@ -1866,7 +1866,9 @@ func errorResponse(c echo.Context, statusCode int, err error) error {

// successResponse responds success.
func successResponse(c echo.Context, v interface{}) error {
return c.JSON(http.StatusOK, v)
c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)
c.Response().WriteHeader(http.StatusOK)
return json.NewEncoder(c.Response()).Encode(v)
}

// noContentResponse
Expand Down
254 changes: 127 additions & 127 deletions result/kataribe.txt

Large diffs are not rendered by default.

26 changes: 13 additions & 13 deletions result/mysqltuner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA
[--] Data in InnoDB tables: 733.8M (Tables: 22)
[--] Data in InnoDB tables: 734.9M (Tables: 22)
[OK] Total fragmented tables: 0

-------- Analysis Performance Metrics --------------------------------------------------------------
Expand All @@ -62,8 +62,8 @@
[OK] NO SECURITY CVE FOUND FOR YOUR VERSION

-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 2h 58m 25s (3M q [281.254 qps], 29K conn, TX: 1G, RX: 1G)
[--] Reads / Writes: 59% / 41%
[--] Up for: 3h 9m 24s (4M q [403.300 qps], 39K conn, TX: 2G, RX: 1G)
[--] Reads / Writes: 60% / 40%
[--] Binary logging is disabled
[--] Physical Memory : 3.8G
[--] Max MySQL memory : 10.8G
Expand All @@ -74,19 +74,19 @@
[!!] Maximum reached memory usage: 10.8G (282.49% of installed RAM)
[!!] Maximum possible memory usage: 10.8G (280.81% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[!!] Slow queries: 115% (3M/3M)
[!!] Slow queries: 109% (5M/4M)
[!!] Highest connection usage: 100% (152/151)
[OK] Aborted connections: 0.00% (1/29284)
[OK] Aborted connections: 0.00% (1/39448)
[!!] Name resolution is active: a reverse name resolution is made for each new connection which can reduce performance
[--] Query cache has been removed since MySQL 8.0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 84K sorts)
[OK] No joins without indexes
[OK] Temporary tables created on disk: 0% (0 on disk / 831 total)
[OK] Thread cache hit rate: 91% (2K created / 29K connections)
[OK] Table cache hit rate: 99% (3M hits / 3M requests)
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 141K sorts)
[!!] Joins performed without indexes: 38
[OK] Temporary tables created on disk: 0% (0 on disk / 848 total)
[OK] Thread cache hit rate: 91% (3K created / 39K connections)
[OK] Table cache hit rate: 99% (4M hits / 4M requests)
[OK] table_definition_cache (2000) is greater than number of tables (349)
[OK] Open file limit used: 0% (1/10K)
[OK] Table locks acquired immediately: 100% (39 immediate / 39 locks)
[OK] Table locks acquired immediately: 100% (50 immediate / 50 locks)

-------- Performance schema ------------------------------------------------------------------------
[--] Performance_schema is activated.
Expand All @@ -103,10 +103,10 @@
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[OK] InnoDB buffer pool / data size: 1.0G / 733.8M
[OK] InnoDB buffer pool / data size: 1.0G / 734.9M
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (9.375%): 48.0M * 2 / 1.0G should be equal to 25%
[!!] InnoDB buffer pool <= 1G and Innodb_buffer_pool_instances(!=1).
[--] Number of InnoDB Buffer Pool Chunk: 8 for 8 Buffer Pool Instance(s)
[OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
[OK] InnoDB Read buffer efficiency: 99.98% (232535408 hits/ 232585535 total)
[OK] InnoDB Read buffer efficiency: 99.98% (297311134 hits/ 297370762 total)
[!!] InnoDB Write Log efficiency: 0% (0 hits/ 0 total)
Loading

0 comments on commit bfe8218

Please sign in to comment.