Issue72

Title Streamline stringReceived
Type wish Status chatting
Importance
Superseder Nosy List mg
Assigned To Keywords design

Created on 2008-10-08.15:54:28 by mg, last changed 2008-11-05.14:46:45 by mg.

Messages
msg291 (view) Author: mg Date: 2008-11-05.14:46:45
And see this patch:

  http://article.gmane.org/gmane.comp.cryptography.viff.patches/66
msg278 (view) Author: mg Date: 2008-10-13.08:28:36
See also Issue 34.
msg264 (view) Author: mg Date: 2008-10-08.15:54:28
The stringReceived method of ShareExchanger starts with

  if self.peer_id is None:
      # Get peer ID.
  else:
      # Handle incoming share.

and it bugs me that we have to do this test every single time we
receive some data from another player!

I have an idea for streamlining this: we could initialize
incoming_data with a Deferred with a program counter of [0] or
something like that and then each player would send its player ID
using that program counter.

This will trigger the Deferred, which will then do what whatever the
first branch of the if-statement does today.

I hope we can gain some performance by having fewer conditional
statements on this critical path.
History
Date User Action Args
2008-11-05 14:46:45mgsetmessages: + msg291
2008-10-13 08:28:36mgsetstatus: unread -> chatting
messages: + msg278
2008-10-08 15:54:28mgcreate