DeepL Free API (No TOKEN required)
Go to file
Vincent Young 2438d72d3f
perf(translate): share oneshot req.Client across requests + eager warmup
Each TranslateByDeepLX call was building a brand-new req.Client via
newOneshotClient(), which meant a fresh TLS handshake + HTTP/2 SETTINGS
negotiation per request — ~200-400ms of pure overhead on top of DeepL's
own ~1.5s processing latency. Share one client per proxy URL
(sync.Map) so subsequent requests reuse the kept-alive HTTP/2
connection in the underlying http.Transport's pool.

Also flip the cookie-jar warmup from synchronous-on-first-call to
fire-and-forget at first client creation. Same sync.Once semantics
(runs exactly once per process), but in a background goroutine so the
first translate request runs in parallel with the TLS handshake to
www.deepl.com rather than serially behind it.

Measured against the live oneshot endpoint (Tokyo → Frankfurt):

  before, 5 sequential requests: 3.19s, 2.05s, 2.07s, 2.89s, 2.22s
  after,  5 sequential requests: 2.20s, 1.27s, 1.26s, 1.42s, 1.34s
                                  └─ first  └────────── warm path ─────┘

The warm-path 1.3s is also faster than a bare \`curl\` to oneshot
(~1.9s, every call doing its own TLS handshake) — proof the
connection-pool reuse is now actually paying off.
2026-05-22 13:02:27 +08:00
.github chore: bump Go version to 1.24.2 in Dockerfile, go.mod, and CI workflows 2025-04-08 14:27:01 -04:00
img docs: add img 2024-03-02 02:47:18 -05:00
service refactor: make service exportable (#183) 2025-04-08 13:53:20 -04:00
translate perf(translate): share oneshot req.Client across requests + eager warmup 2026-05-22 13:02:27 +08:00
.cross_compile.sh ci: fix compile error 2024-03-20 16:52:54 -04:00
.gitignore chore: ignore .DS_Store (#219) 2026-05-22 12:23:11 +08:00
compose.yaml Update compose.yaml 2024-12-22 14:18:30 -05:00
deeplx.service Update deeplx.service 2023-02-18 20:55:20 +08:00
Dockerfile Update Dockerfile to use Go 1.25 base image (#215) 2026-03-18 03:47:26 -07:00
go.mod feat(translate): migrate to oneshot endpoint (#217) 2026-05-22 12:04:44 +08:00
go.sum feat(translate): migrate to oneshot endpoint (#217) 2026-05-22 12:04:44 +08:00
install.sh Update install.sh 2023-02-18 20:57:58 +08:00
LICENSE Create LICENSE 2022-10-20 02:12:18 +08:00
main.go refactor: make service exportable (#183) 2025-04-08 13:53:20 -04:00
me.missuo.deeplx.plist Update README.md 2022-10-20 02:11:14 +08:00
README.md docs: remove icon 2024-11-30 19:56:38 -05:00
uninstall.sh feat(uninstall): Add DeepLX uninstallation script (#203) 2025-08-26 20:34:10 +08:00

GitHub Workflow Go Version Go Report GitHub License Docker Pulls Releases

How to use

!TIP]

Learn more about [📘 Using DeepLX](https://deeplx.owo.network) by checking it out.

Discussion Group

Telegram Group

Acknowledgements

Contributors

Activity

Alt

License

FOSSA Status