Results 1 to 6 of 6

Thread: PyQt performance

  1. #1
    Join Date
    Jul 2009
    Posts
    5
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default PyQt performance

    Hi guys

    I'm considering developing a simple web-browser but im wondering if i should use PyQt or c++
    I have more c++ experience but going python seem like it would save me a lot more time.

    I was juts wondering if their are are any significant speed gain in using c++ over python

  2. #2
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: PyQt performance

    Look here: http://shootout.alioth.debian.org/ so in general C++ is faster. Said that there are task that are done faster in Python. So basically it's all depends on other question: do You want spend more time developing and learn more about Python or code it faster?
    Some time ago I stumble upon a problem with parsing HTML. I did it in PHP and due to "friendly" function this task was easy, then I had the same problem with Qt/C++ and after some research I must say that complexity is the same, just functions changes. Ofcourse higher level languages make it simpler but still I think You will manage to do it in C++/Qt fairly easy (QTcpSocket, QWebkit, QNetworkManager, QCookie, etc... there are ready components).
    Keep in mind that You will work with the same framework, so code is pretty much similar between Python and C++ in that case.

  3. The following user says thank you to Talei for this useful post:

    solartic (3rd July 2010)

  4. #3
    Join Date
    Jul 2009
    Posts
    5
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: PyQt performance

    Thanks for the reply and and that very useful link.
    You want spend more time developing and learn more about Python or code it faster?
    Well both i recently started web development using django/python so i do want to learn more about python as a language and i intend to regardless of what I chose for this project
    Im not really worried about complexity, but after looking at some qt tutorials with exact apps done in both python and c++ the code length in python is almost 1/2 that of the c++ ones.
    Maybe starting with c++ is a good choice still, especial since Im not really sure if ill need the extra power eventually considering i do go through with this project.

  5. #4
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: PyQt performance

    I would disagree about code length. Recently I did MVC in python (with spinbox/checkbox on the view witch delegates etc..) and code length was pretty much the same to the one in C++ (I used in that code 95% Qt code). But, as always, this all depends on the task that program performs. As said before, higher level languages offers more "programmer friendly functions" so the relatively "complex task" can be done with less code.
    I want also point out here, that making Your own web browser is really easy with Qt. Basically use QTcpSocket for communication (or QNetworkAccessManager/ QNetworkReply/ QUrl / QNetworkRequest / QNetworkCookie), retrieve data and send it to the QWebKit. That's practically all what You need to do to make simple web browser. Of course this is a simplification, but bottom line here is that in this project language usage, or language speed, is really the last thing to worries about. (assuming that You will actually use QtNetwork modules)
    Regards

  6. #5
    Join Date
    Jun 2010
    Location
    India
    Posts
    50
    Thanks
    1
    Thanked 15 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: PyQt performance

    hi solartic,

    If you are comfortable with C++ use Qt/C++
    if you are comfortable/like python use PyQt.

    Dont Worry about performance. You cannot see much performance difference between PyQt and Qt/C++ in realtime. You may create C based DLL's for performance intensive code and import them into your python script(Python Extensions). C/C++ is fastest. Python can use C/C++ speed. But Python is simpler than C/C++.

  7. The following user says thank you to agathiyaa for this useful post:

    solartic (4th July 2010)

  8. #6
    Join Date
    Jul 2009
    Posts
    5
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: PyQt performance

    Thanks for the help guys think ill be going with python

Similar Threads

  1. QLibrary in PyQt
    By Urthas in forum Qt Programming
    Replies: 0
    Last Post: 30th October 2009, 18:46
  2. PyQt... What am I doing wrong?!
    By Richie in forum Newbie
    Replies: 2
    Last Post: 4th September 2009, 17:14
  3. PyQt
    By helvin in forum Newbie
    Replies: 1
    Last Post: 15th April 2009, 08:56
  4. Problem with PyQt 4.4.2 and Qt 4.4.0
    By tlam in forum Installation and Deployment
    Replies: 1
    Last Post: 6th August 2008, 16:34
  5. PyQT Problems
    By Detrexer in forum Newbie
    Replies: 1
    Last Post: 27th May 2008, 20:08

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.