[ https://issues.apache.org/jira/browse/THRIFT-599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12899951#action_12899951 ]
Anthony Molinaro commented on THRIFT-599: ----------------------------------------- I've now tried this out and it looks great. I like the new semantics, I can easily wrap a gen_server around the client if I need to, and it seems better overall. The only problem with the patch was it didn't apply totally cleanly with patch -p1. I guess there was a file rename from test_handler.erl to thrift_transport_behaviour.hrl which for some reason patch -p1 was unable to resolve. So I have to move the file after patching, but otherwise please commit to trunk. It would be great to see this in 0.5 > 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.