借助 AI,我让 asyncmy 成为了最快的 Python MySQL/MariaDB 驱动

8 月 12 日
 loveshuyuan

项目地址: https://github.com/long2ice/asyncmy

Test asyncmy Rank Performance
Large Result Set (33k rows, all types) 🏆 #1/4 0.030s — 2.2x faster than mysqlclient, 5.3x faster than aiomysql
Connection Pool (2k queries) 🏆 #1/2 ~17,000 qps — 2x aiomysql's throughput
Concurrent Queries (50 connections) 🏆 #1/2 ~8,000 qps — 1.6x faster than aiomysql
Batch Insert (10k rows) 🏆 #1/4 ~107,000 rows/sec — fastest of all four drivers

项目停止活跃了一段时间,主要是没有精力去维护了。最近突发奇想尝试用 Claude Code 去优化一下性能啥的,结果还不错,横向对比 pymysql/aiomysql/mysqlclient 性能都是第一,详细的 benchmark 可以参考:https://github.com/long2ice/asyncmy/blob/dev/benchmark/README.md。

另外还借助 Claude Code 把所有的 issue 和 PR 都关闭了,看起来清爽多了。

顺便再求个 star 吧,谢谢。

1131 次点击
所在节点    分享创造
4 条回复
tf2
8 月 12 日
这活儿放在 2023 年之前高低也能轰动社区。。但是现在 AI 多了反而不敢用了。。。
loveshuyuan
8 月 12 日
@tf2 2023 之前都没 AI 吧,现在 AI 多了底层库还是需要的,不能啥都让 AI 撸
stephCurry
8 月 12 日
是否 plan 支持 postgres 呢?
loveshuyuan
8 月 12 日
@stephCurry 这是 MySQL 的专有驱动,postgres7 应该用 asyncpg

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1233809

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX