Don't use unnecessary processes in the Erlang transports and clients
--------------------------------------------------------------------

                 Key: THRIFT-599
                 URL: https://issues.apache.org/jira/browse/THRIFT-599
             Project: Thrift
          Issue Type: Improvement
          Components: Library (Erlang)
            Reporter: David Reiss
         Attachments: erlang-refactor-v1.patch

The Erlang library currently spawns a process for every buffered/framed/http 
transport and every client.  These processes can be eliminated by by making 
client, protocol, and transport operations work like operations on Erlang's 
persistent data structures (like dict): every mutating call returns the new 
version of the object.  This has four benefits.

- Easier debugging: single stepping into a gen_server:call is very difficult.
- Better error messages: problems that occur during Thrift operations are 
localized to a single process, providing a better stack trace and eliminating 
uninformative crash reports.
- More measurable performance: time spent in Thrift client operations will show 
up in etop under the process making the call, rather than in a transient client 
or transport process.
- Better performance: I haven't actually measured this, but I'm pretty sure 
that eliminating the extra spawns and messages will speed things up.

The only user-visible changes are to the client.  Every thrift call now returns 
{NewClient, Result} instead of just Result.

I'm attaching a big monolithic patch, but a fairly readable chronology of my 
changes is at 
<http://gitweb.thrift-rpc.org/?p=thrift.git;a=log;h=refs/heads/pri/dreiss/erl-refactor;hb=HEAD>.
  I'm open to opinions as to whether this should be committed as one rev or 
many.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to