Whole-known-network
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@tef" class="u-url mention">@<span>tef</span></a></span> <span class="h-card" translate="no"><a href="https://hachyderm.io/@SnoopJ" class="u-url mention">@<span>SnoopJ</span></a></span> <span class="h-card" translate="no"><a href="https://chaos.social/@gsuberland" class="u-url mention">@<span>gsuberland</span></a></span> <span class="h-card" translate="no"><a href="https://social.coop/@jsbarretto" class="u-url mention">@<span>jsbarretto</span></a></span> (in general, pypy has been so uncompetitive that i think the right way to go is to put most small-scale byte-shuffling into a rust extension and call it a day. also simplifies dealing with usb. i'm not sure why, and trying to find out was difficult because i find pypy debug traces very difficult to understand)</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@tef" class="u-url mention">@<span>tef</span></a></span> <span class="h-card" translate="no"><a href="https://hachyderm.io/@SnoopJ" class="u-url mention">@<span>SnoopJ</span></a></span> <span class="h-card" translate="no"><a href="https://chaos.social/@gsuberland" class="u-url mention">@<span>gsuberland</span></a></span> <span class="h-card" translate="no"><a href="https://social.coop/@jsbarretto" class="u-url mention">@<span>jsbarretto</span></a></span> given this, it's very interesting to consider why my network card project receives only marginal benefits from pypy despite being basically straight line code with no type polymorphism</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> <span class="h-card" translate="no"><a href="https://hachyderm.io/@SnoopJ" class="u-url mention">@<span>SnoopJ</span></a></span> <span class="h-card" translate="no"><a href="https://chaos.social/@gsuberland" class="u-url mention">@<span>gsuberland</span></a></span> <span class="h-card" translate="no"><a href="https://social.coop/@jsbarretto" class="u-url mention">@<span>jsbarretto</span></a></span> it meant not having to write twisted</p>
<p><span class="h-card" translate="no"><a href="https://hachyderm.io/@SnoopJ" class="u-url mention">@<span>SnoopJ</span></a></span> <span class="h-card" translate="no"><a href="https://mastodon.social/@tef" class="u-url mention">@<span>tef</span></a></span> <span class="h-card" translate="no"><a href="https://chaos.social/@gsuberland" class="u-url mention">@<span>gsuberland</span></a></span> <span class="h-card" translate="no"><a href="https://social.coop/@jsbarretto" class="u-url mention">@<span>jsbarretto</span></a></span> hey, could've been ruby</p>
<p><span class="h-card" translate="no"><a href="https://hachyderm.io/@SnoopJ" class="u-url mention">@<span>SnoopJ</span></a></span> <span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> <span class="h-card" translate="no"><a href="https://chaos.social/@gsuberland" class="u-url mention">@<span>gsuberland</span></a></span> <span class="h-card" translate="no"><a href="https://social.coop/@jsbarretto" class="u-url mention">@<span>jsbarretto</span></a></span> </p><p>practically speaking, most dynamic language overhead comes from dynamic dispatch, rather than interpreter overhead</p><p>cpython's bytecode interpreter still competes with the copy and patch jit</p><p>it's really only tight loops where the small costs accumulate wildly where it's pain</p><p>here, each python stub is more like a tiny event handler</p>
<p><span class="h-card" translate="no"><a href="https://hachyderm.io/@SnoopJ" class="u-url mention">@<span>SnoopJ</span></a></span> <span class="h-card" translate="no"><a href="https://mastodon.social/@tef" class="u-url mention">@<span>tef</span></a></span> <span class="h-card" translate="no"><a href="https://chaos.social/@gsuberland" class="u-url mention">@<span>gsuberland</span></a></span> <span class="h-card" translate="no"><a href="https://social.coop/@jsbarretto" class="u-url mention">@<span>jsbarretto</span></a></span> it's interesting to consider why they made stackless python (they made it, right?)</p><p>my understanding is that it's mostly a memory pressure thing that lets you write less convoluted concurrent code so that you can do ~thread per connection (it predates async by over 15 years!) without a stack per connection, more so than a speedup for anything</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@tef" class="u-url mention">@<span>tef</span></a></span> <span class="h-card" translate="no"><a href="https://chaos.social/@gsuberland" class="u-url mention">@<span>gsuberland</span></a></span> <span class="h-card" translate="no"><a href="https://social.coop/@jsbarretto" class="u-url mention">@<span>jsbarretto</span></a></span> <span class="h-card" translate="no"><a href="https://hachyderm.io/@SnoopJ" class="u-url mention">@<span>SnoopJ</span></a></span> exactly</p><p>that and maintaining algorithmic complexity low</p><p>_should_ you do this in your business? hell no, use rust or lua or something. what i'm doing is an overly drawn out party trick. but if you choose to do it for some reason, you can often just pull it off</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@whitequark" class="u-url mention">@<span>whitequark</span></a></span> <span class="h-card" translate="no"><a href="https://chaos.social/@gsuberland" class="u-url mention">@<span>gsuberland</span></a></span> <span class="h-card" translate="no"><a href="https://social.coop/@jsbarretto" class="u-url mention">@<span>jsbarretto</span></a></span> <span class="h-card" translate="no"><a href="https://hachyderm.io/@SnoopJ" class="u-url mention">@<span>SnoopJ</span></a></span> </p><p>shuffling bytes around with dynamic languages is very much the "never underestimate the bandwidth of a station wagon full of tape" school of programming</p>
<p><span class="h-card" translate="no"><a href="https://mastodon.social/@tef" class="u-url mention">@<span>tef</span></a></span> <span class="h-card" translate="no"><a href="https://chaos.social/@gsuberland" class="u-url mention">@<span>gsuberland</span></a></span> <span class="h-card" translate="no"><a href="https://social.coop/@jsbarretto" class="u-url mention">@<span>jsbarretto</span></a></span> <span class="h-card" translate="no"><a href="https://hachyderm.io/@SnoopJ" class="u-url mention">@<span>SnoopJ</span></a></span> i wrote a network card entirely in python once and it can handle hundreds of megabits of traffic even when it shuffles individual packets around</p><p>this is without any jit. just normal cpython</p><p>people _really_ underestimate cpython a lot</p>