Random Geek on Nostr: After watching a few videos, some fiddling around with making my #Python code faster ...
After watching a few videos, some fiddling around with making my #Python code faster (not like C fast, just fast enough to still feel useful with chunky tasks)
A basic longest common subsequence over 2 arrays w/25,000 elements each was 1m55s in CPython, 12s in Pypy, and 2s with CPython + Numba. (no parallelism or anything fancy applied by me, just a couple nested loops)
Good to know.
Published at
2025-05-01 06:10:20 UTCEvent JSON
{
"id": "77be525b3221bc0fb4e95eb616a866a61320637750eca1972ad8636641cc1058",
"pubkey": "0462da3dca368093716c4e3432bc7699b053d1963b4a19bde1244338203b07f1",
"created_at": 1746079820,
"kind": 1,
"tags": [
[
"proxy",
"https://masto.hackers.town/@randomgeek/114431087096195480",
"web"
],
[
"t",
"python"
],
[
"proxy",
"https://masto.hackers.town/users/randomgeek/statuses/114431087096195480",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://masto.hackers.town/users/randomgeek/statuses/114431087096195480",
"pink.momostr"
],
[
"-"
]
],
"content": "After watching a few videos, some fiddling around with making my #Python code faster (not like C fast, just fast enough to still feel useful with chunky tasks)\n\nA basic longest common subsequence over 2 arrays w/25,000 elements each was 1m55s in CPython, 12s in Pypy, and 2s with CPython + Numba. (no parallelism or anything fancy applied by me, just a couple nested loops)\n\nGood to know.",
"sig": "dcc158f5bef81e107ad8133013e6de8839b19f183ce81859f77b7714633ecd4db8363b0902b82dd9c1d73c354737516ac6401d84c75a56a4c6398e5d929f445e"
}