mirror of
https://github.com/lukaszraczylo/go-telegram.git
synced 2026-06-05 22:43:59 +00:00
607c3e8ddd
Adds test/benchmarks/ as a separate Go module so competitor deps
(go-telegram-bot-api/v5, telebot.v3, go-telegram/bot, telego,
echotron/v3) stay out of the root go.mod.
Hot paths covered:
- Webhook decode (small Update -> typed Update struct)
- Large unmarshal (Update with entities + reply markup + photo array)
- API round-trip (sendMessage against httptest.Server)
- Dispatch route (20 handlers, last-registered matches)
Results on Apple M4 Max / go1.26.2: ours wins 3 of 4 paths and is
2nd of 5 in the round-trip path. Full report at
docs/benchmarks/2026-05-10-comparison.md, raw output committed under
test/benchmarks/results/.
Caveats called out in the report:
- codec asymmetry (we ship goccy/go-json; competitors mostly stdlib)
- echotron call bench skipped — built-in rate limiter not externally
configurable; would measure throttling, not the library
- dispatch bench limited to libs with a public sync entry point
(ours, telebot, gobot); gotba has no dispatcher, telego/echotron
use channel/per-chat paradigms not directly comparable
Also gitignores docs/superpowers/ (local brainstorm/spec scratch)
and regenerates docs/reference/dispatch.md after the new
Router.Process method.
34 lines
1.2 KiB
Modula-2
34 lines
1.2 KiB
Modula-2
module github.com/lukaszraczylo/go-telegram/test/benchmarks
|
|
|
|
go 1.25.7
|
|
|
|
replace github.com/lukaszraczylo/go-telegram => ../../
|
|
|
|
require (
|
|
github.com/NicoNex/echotron/v3 v3.45.0
|
|
github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1
|
|
github.com/go-telegram/bot v1.20.0
|
|
github.com/lukaszraczylo/go-telegram v0.0.0-00010101000000-000000000000
|
|
github.com/mymmrac/telego v1.8.0
|
|
gopkg.in/telebot.v3 v3.3.8
|
|
)
|
|
|
|
require (
|
|
github.com/andybalholm/brotli v1.2.0 // indirect
|
|
github.com/bytedance/gopkg v0.1.3 // indirect
|
|
github.com/bytedance/sonic v1.15.0 // indirect
|
|
github.com/bytedance/sonic/loader v0.5.0 // indirect
|
|
github.com/cloudwego/base64x v0.1.6 // indirect
|
|
github.com/goccy/go-json v0.10.6 // indirect
|
|
github.com/grbit/go-json v0.11.0 // indirect
|
|
github.com/klauspost/compress v1.18.2 // indirect
|
|
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
|
|
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
|
github.com/valyala/bytebufferpool v1.0.0 // indirect
|
|
github.com/valyala/fasthttp v1.69.0 // indirect
|
|
github.com/valyala/fastjson v1.6.10 // indirect
|
|
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
|
|
golang.org/x/sys v0.39.0 // indirect
|
|
golang.org/x/time v0.5.0 // indirect
|
|
)
|