2
<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&#39;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&#39;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&#39;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&#39;s bytecode interpreter still competes with the copy and patch jit</p><p>it&#39;s really only tight loops where the small costs accumulate wildly where it&#39;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&#39;s interesting to consider why they made stackless python (they made it, right?)</p><p>my understanding is that it&#39;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&#39;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 &quot;never underestimate the bandwidth of a station wagon full of tape&quot; 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>