[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] Python MQTT native vs. as binding

I'm pretty experienced using SWIG. I commonly use it to wrap C++11 libraries so that I can debug interactively with Python, and then write test and diagnostics apps in Python as well. But I deliver the final apps in C++, so I've never looked into the performance or efficiency of the SWIG wrappers.

I can help out with SWIG if anyone thinks we might want to go this way.

But first I would ask two questions:
(1) In a networked application is the Python client layer the real bottleneck?
(2) In a high performance application would you use Python for the app?

I don't mean to insult anyone's personal love for one language or another, but it would be interesting to devise a performance test for the different language client libraries so that we can make a development-time vs performance decision for individual projects.

Frank

On 12/01/2017 08:55 AM, Ian Craggs wrote:

I've considered using SWIG before, but haven't (yet) invested the time & effort into getting it working. Again, I'm fully open to contributions if someone gets there before me :-)

Ian

On 01/12/2017 13:46, Benjamin Cabà wrote:
I would be curious to know if people have experience with SWIG?Âhttp://www.swig.org/
It seems to provide a nice way to generate palatable bindings to native libraries (i.e it provides flexibility on how the language-specific APIs should look like, and helps maintain several language bindings easily if the underlying native libraryâs API evolves).

You can look at the *.i files in there - https://github.com/intel-iot-devkit/upm/tree/master/src/bma220Â-Âas an example of how Intel UPM uses SWIG for Java, JS, and Python out of C++ code
One thing that Iâm not sure of, for the very little Iâve looked at Intelâs stuff, is the footprint/efficiency of the generated SWIG code.

Benjamin -


Le 1 dÃc. 2017 Ã 13:59, Ian Craggs <icraggs@xxxxxxxxxxxxxxxxxxxxxxx> a Ãcrit :

Hi Jos,

the answer is yes :-)

I wrote a Python binding a while ago, but when I first talked about it, a had a couple of comments about a pure Python client being more desirable, so I let it have a low profile. I haven't touched it in a couple of years, so it might need updating. You can find it in the test directory of project:

https://github.com/eclipse/paho.mqtt.c/tree/master/test/python

If there is interest, I can look into adding it to the project properly. And obviously I would appreciate any contributions made in this area :-)

I haven't done any performance comparisons between Python and C implementations, so I can't comment to the size of the advantage, if any.

Ian


On 01/12/2017 12:41, Jos Vos wrote:
Hi,

Just wondering:

The Paho-MQTT Python package now seems to implement the MQTT protocol
purely in Python. ÂI'm using it and in principle I'm happy with it.

But did someone ever think of writing a Python binding for the Paho-C
library and could that improve performance for high-volume clients
(think of thousands of messages per second received/published)?


--
Ian Craggs
icraggs@xxxxxxxxxx ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂIBM United Kingdom
Paho Project Lead; Committer on Mosquitto

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev



_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev

-- 
Ian Craggs
icraggs@xxxxxxxxxx                 IBM United Kingdom
Paho Project Lead; Committer on Mosquitto


_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/paho-dev