Show
Ignore:
Timestamp:
04/02/08 17:41:43 (20 months ago)
Author:
dsallings
Message:

Syscall optimizations from Trond Norbye.

From Trond:
I have been using the last two days to test the modifications I have done to
the binary protocol, and I have not been able to find any new bugs. From my
testing the binary protocol now use the same amount of system calls as the
textual protocol.

I have tried to use a common state machine, and branch the execution path as
late as possible.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/binary/server/memcached.h

    r772 r775  
    176176#define ITEM_ntotal(item) (sizeof(struct _stritem) + (item)->nkey + 1 + (item)->nsuffix + (item)->nbytes) 
    177177 
     178/** 
     179 * NOTE: If you modify this table you _MUST_ update the function state_text 
     180 */ 
    178181enum conn_states { 
    179182    conn_listening,  /** the socket which listens for connections */ 
     183    conn_new_cmd,    /** Prepare connection for next command */ 
     184    conn_waiting,    /** waiting for a readable socket */ 
    180185    conn_read,       /** reading in a command line */ 
     186    conn_parse_cmd,  /** try to parse a command from the input buffer */ 
    181187    conn_write,      /** writing out a simple response */ 
    182188    conn_nread,      /** reading in a fixed number of bytes */ 
     
    184190    conn_closing,    /** closing this connection */ 
    185191    conn_mwrite,     /** writing out many items sequentially */ 
    186     conn_bin_init,   /** Reinitializing a binary protocol connection */ 
    187     conn_negotiate,  /** Negotiating a protocol */ 
     192    conn_max_state,  /** Max state value (used for assertion) */ 
    188193}; 
    189194