============================================================ Benchmarks ============================================================
(b *testing.B)
| 941 | // ============================================================ |
| 942 | |
| 943 | func BenchmarkCreateTableStatementPool(b *testing.B) { |
| 944 | b.Run("GetPutCreateTableStatement", func(b *testing.B) { |
| 945 | b.ReportAllocs() |
| 946 | for i := 0; i < b.N; i++ { |
| 947 | stmt := GetCreateTableStatement() |
| 948 | stmt.Name = "users" |
| 949 | stmt.IfNotExists = true |
| 950 | stmt.Columns = append(stmt.Columns, ColumnDef{ |
| 951 | Name: "id", |
| 952 | Type: "BIGINT", |
| 953 | Constraints: []ColumnConstraint{ |
| 954 | {Type: "NOT NULL", Default: &LiteralValue{Value: "0"}}, |
| 955 | }, |
| 956 | }) |
| 957 | PutCreateTableStatement(stmt) |
| 958 | } |
| 959 | }) |
| 960 | |
| 961 | b.Run("AllocCreateTableStatement", func(b *testing.B) { |
| 962 | b.ReportAllocs() |
| 963 | for i := 0; i < b.N; i++ { |
| 964 | stmt := &CreateTableStatement{ |
| 965 | Name: "users", |
| 966 | IfNotExists: true, |
| 967 | Columns: []ColumnDef{ |
| 968 | { |
| 969 | Name: "id", |
| 970 | Type: "BIGINT", |
| 971 | Constraints: []ColumnConstraint{ |
| 972 | {Type: "NOT NULL", Default: &LiteralValue{Value: "0"}}, |
| 973 | }, |
| 974 | }, |
| 975 | }, |
| 976 | } |
| 977 | _ = stmt |
| 978 | } |
| 979 | }) |
| 980 | } |
| 981 | |
| 982 | func BenchmarkAlterTableStatementPool(b *testing.B) { |
| 983 | b.Run("GetPutAlterTableStatement", func(b *testing.B) { |
nothing calls this directly
no test coverage detected