True, but Python does make everything much easier, so it's interesting to see how well
a Python implementation can perform.
I've been thinking of other ways to optimize (at least selectively) the packet parsing
machinery. That's a major chunk of the code, and a lot of the time in the forwarding
process is taken doing that. The way I implemented it is very convenient and flexible,
but it's not the fastest way. I keep thinking of ways to do some of them faster, so
for example there would be shortcuts in the handling of route headers on data packets.
paul
On Jun 24, 2024, at 9:04 PM, Johnny Billquist
<bqt(a)softjar.se> wrote:
You know that if you really want to focus on performance, Python should not be used in
the first place... ;-)
Johnny
On 2024-06-25 02:39, Paul Koning wrote:
I was just reading about an alternate Python
implementation called PyPy, which uses a "just in time" compiler. With that
it's supposed to be potentially a lot faster than regular Python, for code that does a
fair amount of computation.
While PyDECnet does plenty of I/O, things like packet parsing are fairly time consuming.
I've optimized it a bit but the structure I adopted only allows for so much.
I tried PyPy to see if it supports PyDECnet. The answer is yes, after I removed some
code from two files that wasn't even used in the first place...
Just to see if it makes a big difference, I did a large loop test: "ncp loop nod 0
count 50000 len 400". On my Mac (ARM) laptop, that takes 6.3 seconds with Python
3.13, and 1.2 seconds with PyPy.
More testing is needed but this is interesting.
paul
_______________________________________________
HECnet mailing list -- hecnet(a)lists.dfupdate.se
To unsubscribe send an email to hecnet-leave(a)lists.dfupdate.se
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: bqt(a)softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
_______________________________________________
HECnet mailing list -- hecnet(a)lists.dfupdate.se
To unsubscribe send an email to hecnet-leave(a)lists.dfupdate.se