GoyGram
Reference

Benchmarks

Reproducible measurements live in the benchmarks/ directory of the main repository. The scripts compare GoyGram against telethon, pyrogram, aiogram, python-telegram-bot, and tgcrypto on the same machine.

All numbers are GoyGram 0.8.4 on an AMD Ryzen 9 5950X VPS. Tables use medians of repeated runs pinned to one CPU.

AES-256-IGE throughput (MB/s, higher is better)

Library256 B4 KiB64 KiB
GoyGram (Rust, AES-NI, built-in)503.7969.31062.5
tgcrypto 1.2.5 (C, separate install)151.3198.6204.3
pyrogram144.9196.2202.4
telethon (default)9.010.510.8

Per-message latency at 256 B: GoyGram 0.6 µs, tgcrypto 1.6 µs, pyrogram 1.7 µs, telethon 29.4 µs.

GoyGram's IGE path uses AES-NI intrinsics selected at runtime with a software fallback. tgcrypto 1.2.5 is table-based software AES, which is why the gap is 3-4.7x. Both are far beyond what a Telegram client needs. The network round-trip dominates. GoyGram's crypto is built in, while tgcrypto (or Telethon's cryptg) is a separate install.

TL codec, simple (ops/s)

Operationops/s
serialize messages.sendMessage351,270
loads message577,821

TL codec, realistic updateNewMessage (ops/s)

Payload: ~200-char text, forward header, inline keyboard. Packet 356 B.

Operationops/s
dumps updateNewMessage97,283
loads updateNewMessage225,347
echo loads+dumps107,395
AES-256-IGE enc+dec of that packet889,291

loads latency (µs): p50 3.8, p95 6.4, p99 8.9, p99.9 20.7.

The full official schema (layer 229, 823 methods, 1698 constructors) loads once per process. Warm loads is a few microseconds.

AES-256-GCM (4 KiB, ops/s)

Used for vault encryption:

Operationops/s
encrypt293,032
decrypt290,105

Cold import time (ms, lower is better)

Libraryms
GoyGram77.2
python-telegram-bot142.8
telethon342.0
pyrogram461.5
aiogram3016.3

Memory, RSS delta after import (MB, lower is better)

LibraryMB
GoyGram10.8
python-telegram-bot18.8
pyrogram35.6
telethon48.4
aiogram152.2

Reproduce

git clone https://github.com/GoyGram/GoyGram && cd GoyGram/benchmarks
python -m venv .bench && source .bench/bin/activate
python -m pip install goygram telethon tgcrypto pyrogram aiogram python-telegram-bot
python bench_crypto.py
python bench_codec.py
python bench_import.py

Numbers above were measured on a single VPS with an AMD Ryzen 9 5950X; expect different absolute values on other hardware, similar ratios.

On this page