Ampoule vs PerspectiveBroker
Which is the recommended way for interprocess communication these days? Is it the existing PerspectiveBroker or Ampoule (which uses AMP as the underlying RPC protocol)? Are there drawbacks/benefits to either of them? Jacek
On Oct 13, 2011, at 11:41 AM, Jacek Furmankiewicz wrote:
Which is the recommended way for interprocess communication these days?
Is it the existing PerspectiveBroker or Ampoule (which uses AMP as the underlying RPC protocol)? Are there drawbacks/benefits to either of them?
Somebody should probably write an AMP vs. PB wiki page or something, this does come up every so often. Briefly: PB's strength is that it allows you to serialize and synchronize large, complex object graphs with relatively little effort, but more safely and explicitly than (for example) Pickle would allow you to do. Doing this with AMP would require specifying a large protocol with lots of object IDs, and you'd have to manage their mappings yourself. AMP's strength is that it's simple and visualizing the wire format is easy. Most importantly you can visualize the wire format by looking at static declarations of commands and their responses, without ever examining any code. This allows you to easily provide AMP interfaces between multiple languages (for example, C#: http://amp-protocol.net/AmpSharp). This also means that AMP is a bit more performant (on current trunk, on CPython, ~2300 AMP/sec as opposed to ~1300 PB/sec). A bit more effort has been going into AMP lately because many core Twisted developers now believe that AMP covers more and more common use-cases, and that should generally be the default choice for most new protocol work. Bottom line: you should try AMP first, and if you find it's too tedious, maybe give PB a shot and see if it simplifies your protocol code.
OK, I will look at Ampoule and deferToAMPProcess while looking into the
CorePost multicore support.
Thanks Glyph,
Jacek
On Thu, Oct 13, 2011 at 1:01 PM, Glyph
On Oct 13, 2011, at 11:41 AM, Jacek Furmankiewicz wrote:
Which is the recommended way for interprocess communication these days?
Is it the existing PerspectiveBroker or Ampoule (which uses AMP as the underlying RPC protocol)? Are there drawbacks/benefits to either of them?
Somebody should probably write an AMP vs. PB wiki page or something, this does come up every so often.
Briefly: PB's strength is that it allows you to serialize and synchronize large, complex object graphs with relatively little effort, but more safely and explicitly than (for example) Pickle would allow you to do. Doing this with AMP would require specifying a large protocol with lots of object IDs, and you'd have to manage their mappings yourself.
AMP's strength is that it's simple and visualizing the wire format is easy. Most importantly you can visualize the wire format by looking at static declarations of commands and their responses, without ever examining any code. This allows you to easily provide AMP interfaces between multiple languages (for example, C#: http://amp-protocol.net/AmpSharp). This also means that AMP is a bit more performant (on current trunk, on CPython, ~2300 AMP/sec as opposed to ~1300 PB/sec).
A bit more effort has been going into AMP lately because many core Twisted developers now believe that AMP covers more and more common use-cases, and that should generally be the default choice for most new protocol work.
Bottom line: you should try AMP first, and if you find it's too tedious, maybe give PB a shot and see if it simplifies your protocol code. _______________________________________________ Twisted-web mailing list Twisted-web@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web
On 10/13/11 7:01 PM, Glyph wrote:
On Oct 13, 2011, at 11:41 AM, Jacek Furmankiewicz wrote:
Which is the recommended way for interprocess communication these days?
Is it the existing PerspectiveBroker or Ampoule (which uses AMP as the underlying RPC protocol)? Are there drawbacks/benefits to either of them?
Bottom line: you should try AMP first, and if you find it's too tedious, maybe give PB a shot and see if it simplifies your protocol code.
I also recomment that you look at JSON-RPC: https://github.com/bbqsrc/txjsonrpc We've had a lot of success with jsonrpc, and prefer it to AMP. -Johan
On Thu, Oct 13, 2011 at 11:41 AM, Jacek Furmankiewicz
Which is the recommended way for interprocess communication these days?
Is it the existing PerspectiveBroker or Ampoule (which uses AMP as the underlying RPC protocol)? Are there drawbacks/benefits to either of them?
Glyph's response is good, but I wanted to clarify something: You shouldn't be comparing PB to Ampoule, you should be comparing PB to AMP. Ampoule is a different kind of thing entirely, it just happens to use AMP for communication between processes. -- Christopher Armstrong http://radix.twistedmatrix.com/ http://planet-if.com/
participants (4)
-
Christopher Armstrong
-
Glyph
-
Jacek Furmankiewicz
-
Johan Rydberg