Skip to content

Instantly share code, notes, and snippets.

@shaunlee
shaunlee / sqlite_write_performance.md
Last active February 29, 2024 06:46
Bunjs SQLite has poor write performance

The bun:sqlite has a write performance of only 957/s on SSD, while the node better-sqlite3 has 51080/s.

Test results:

bun:sqlite, ssd: 957/s
bun:sqlite, memory: 66906/s
node better-sqlite3, ssd: 51080/s
node better-sqlite3, memory: 56863/s
go-sqlite3, ssd: 49453/s
go-sqlite3, memory: 54632/s
@shaunlee
shaunlee / tracker.go
Last active June 22, 2024 01:44
HTTP request/response logger
package tracker
import (
"fmt"
"github.com/gofiber/fiber/v2"
"log"
"strings"
"time"
)
@shaunlee
shaunlee / validator.go
Last active June 22, 2024 02:51
Form validation with custom errors and nested structs
package forms
import (
"github.com/go-playground/validator/v10"
"github.com/gofiber/fiber/v2"
"reflect"
"strings"
)
/*