What happens if you write a TCP stack in Python?
1–10 of 125 posts
Re: What happens if you write a TCP stack in Python?
#2Re: What happens if you write a TCP stack in Python?
#3Fun read. Does anyone here know how to deal with the Python being slow at sending ACK packets problem? Or is it a built-in limitation that comes with dealing with high level languages?
Also its likely more a python problem than a "high level" language problem.
Re: What happens if you write a TCP stack in Python?
#4Anyone know why the Python program is so slow? I'm looking at the code and my first guess would be this part[1] but I can't explain why, overall, it would be so slow that a remote host would close the connection.
[1] https://github.com/jvns/teeceepee/blob/7e93970e16fbb0c3d4bee...
Re: What happens if you write a TCP stack in Python?
#5Re: What happens if you write a TCP stack in Python?
#6Fun read. Does anyone here know how to deal with the Python being slow at sending ACK packets problem? Or is it a built-in limitation that comes with dealing with high level languages?
Implement it in C. Also its likely more a python problem than a "high level" language problem.
Re: What happens if you write a TCP stack in Python?
#7Fun read. Does anyone here know how to deal with the Python being slow at sending ACK packets problem? Or is it a built-in limitation that comes with dealing with high level languages?
As the other post suggests, this is not a problem in all high-level languages; it's possible to write very high-performance code in Haskell or Ocaml, for example. But python's semantics are e.g. that every object has its own methods that can be overridden arbitrarily, which means that every single method call pretty much has to involve a hash table lookup. 99% of Python code never uses this extreme dynamism (usually you define methods on classes, and if you want an instance with a different implementation for a particular method then you make a subclass), but it's there, and a Python interpreter that didn't respect that would behave incorrectly.
Re: What happens if you write a TCP stack in Python?
#8Re: What happens if you write a TCP stack in Python?
#9---- SYN ---->
---- ACK ---->
rather than having the client send two SYNs to the server?
Re: What happens if you write a TCP stack in Python?
#10Somebody's oversubscribed $3/month shared PHP hosting might not ramp up the speed as quickly.