2.3-2.5 what improved?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robin Becker

    #1

    2.3-2.5 what improved?

    A large cgi based web Python-2.3 application needs to be speed improved.
    experiments show the following under reasonable testing (these are 2 second
    reportlab pdf productions)

    1) 2.3 --2.5 improvement small 1-2%
    2) cgi --fcgi improvement medium 10-12%

    I sort of remember claims being made about 2.5 being 10% faster than 2.4/2.3 etc
    etc. Can anyone say where the speedups were? Presumably we have a lot of old
    cruft that could be improved in some way eg moving loops into comprehensions,
    using iterator methods etc. Are those sort of things what we should look at?
    --
    Robin Becker

  • robert

    #2
    Re: 2.3-2.5 what improved?

    Robin Becker wrote:
    A large cgi based web Python-2.3 application needs to be speed improved.
    experiments show the following under reasonable testing (these are 2
    second reportlab pdf productions)
    >
    1) 2.3 --2.5 improvement small 1-2%
    2) cgi --fcgi improvement medium 10-12%
    >
    I sort of remember claims being made about 2.5 being 10% faster than
    2.4/2.3 etc etc. Can anyone say where the speedups were? Presumably we
    have a lot of old cruft that could be improved in some way eg moving
    loops into comprehensions, using iterator methods etc. Are those sort of
    things what we should look at?
    Python 2.5 became quite fat. For bare CGI the Python load/init
    time eats all improvements. Smaller scripts even loose lot of speed.

    I still like Python 2.3 for many other reasons for many
    applications - especially for CGI's, on Windows, for deployable
    apps, GUI's etc. because the fat coming with Python 2.4 is not
    balanced by necessary goods - mostly just fancy things.
    ( I run even a list of patches and module copies/addaptations down
    to 2.3 because of that :-) )

    Real news come with Py3K


    Robert

    Comment

    • bruno.desthuilliers@gmail.com

      #3
      Re: 2.3-2.5 what improved?


      Robin Becker a écrit :
      A large cgi based web Python-2.3 application needs to be speed improved.
      experiments show the following under reasonable testing (these are 2 second
      reportlab pdf productions)
      >
      1) 2.3 --2.5 improvement small 1-2%
      2) cgi --fcgi improvement medium 10-12%
      >
      I sort of remember claims being made about 2.5 being 10% faster than 2.4/2.3 etc
      etc. Can anyone say where the speedups were?
      AFAIK, most of the speedup comes from optimization of the builtin dict
      type, which is the central
      data structure in Python. But anyway, as Robert pointed out, using CGI
      means lauching
      a new Python process for each and every HTTP request.
      Presumably we have a lot of old
      cruft that could be improved in some way eg moving loops into comprehensions,
      using iterator methods etc. Are those sort of things what we should look at?
      Consider profiling your code before doing anything else - unless you're
      planning on wasting your time.

      Comment

      • billie

        #4
        Re: 2.3-2.5 what improved?


        robert wrote
        Robin Becker wrote:
        A large cgi based web Python-2.3 application needs to be speed improved.
        experiments show the following under reasonable testing (these are 2
        second reportlab pdf productions)

        1) 2.3 --2.5 improvement small 1-2%
        2) cgi --fcgi improvement medium 10-12%

        I sort of remember claims being made about 2.5 being 10% faster than
        2.4/2.3 etc etc. Can anyone say where the speedups were? Presumably we
        have a lot of old cruft that could be improved in some way eg moving
        loops into comprehensions, using iterator methods etc. Are those sort of
        things what we should look at?
        >
        Python 2.5 became quite fat. For bare CGI the Python load/init
        time eats all improvements. Smaller scripts even loose lot of speed.
        I still like Python 2.3 for many other reasons for many
        applications - especially for CGI's, on Windows, for deployable
        apps, GUI's etc. because the fat coming with Python 2.4 is not
        balanced by necessary goods - mostly just fancy things.
        What do you mean? Fat of libraries or fat itself?
        I tought that 2.5 was faster than precedent versions! :-\

        Comment

        • Robin Becker

          #5
          Re: 2.3-2.5 what improved?

          bruno.desthuill iers@gmail.com wrote:
          Robin Becker a écrit :
          >........
          >
          AFAIK, most of the speedup comes from optimization of the builtin dict
          type, which is the central
          data structure in Python. But anyway, as Robert pointed out, using CGI
          means lauching
          a new Python process for each and every HTTP request.
          >
          >Presumably we have a lot of old
          >cruft that could be improved in some way eg moving loops into comprehensions,
          >using iterator methods etc. Are those sort of things what we should look at?
          >
          Consider profiling your code before doing anything else - unless you're
          planning on wasting your time.
          our major show stoppers(stuff like stringWidth) are already in C; the remainder
          are rather complex methods to do things like paragraph splitting. We're already
          considering fcgi to eliminate the startup time. A trial with psyco indicates
          another 15% could be obtained there, but I don't think we can use that on the
          target platform (which I think is sparc).
          --
          Robin Becker

          Comment

          • Bruno Desthuilliers

            #6
            Re: 2.3-2.5 what improved?

            billie a écrit :
            robert wrote
            >
            >Robin Becker wrote:
            >>A large cgi based web Python-2.3 application needs to be speed improved.
            >>experiments show the following under reasonable testing (these are 2
            >>second reportlab pdf productions)
            >>>
            >>1) 2.3 --2.5 improvement small 1-2%
            >>2) cgi --fcgi improvement medium 10-12%
            >>>
            >>I sort of remember claims being made about 2.5 being 10% faster than
            >>2.4/2.3 etc etc. Can anyone say where the speedups were? Presumably we
            >>have a lot of old cruft that could be improved in some way eg moving
            >>loops into comprehensions, using iterator methods etc. Are those sort of
            >>things what we should look at?
            >Python 2.5 became quite fat. For bare CGI the Python load/init
            >time eats all improvements. Smaller scripts even loose lot of speed.
            >I still like Python 2.3 for many other reasons for many
            >applications - especially for CGI's, on Windows, for deployable
            >apps, GUI's etc. because the fat coming with Python 2.4 is not
            >balanced by necessary goods - mostly just fancy things.
            >
            What do you mean? Fat of libraries or fat itself?
            I tought that 2.5 was faster than precedent versions! :-\
            >
            It is. But it takes a bit more time to launch the interpreter. Which is
            barely noticiable in most cases, but can be start to be a problem with CGI.

            Comment

            • Gabriel Genellina

              #7
              Re: 2.3-2.5 what improved?

              At Wednesday 17/1/2007 10:29, billie wrote:
              Python 2.5 became quite fat. For bare CGI the Python load/init
              time eats all improvements. Smaller scripts even loose lot of speed.
              >What do you mean? Fat of libraries or fat itself?
              >I tought that 2.5 was faster than precedent versions! :-\
              It runs faster, but has a slower start time. For CGI, when you launch
              a new process with every request, this is bad.
              (This is a general problem with CGI itself - perhaps one should
              consider other alternatives, like FastCGI, mod_python, WSGI...)


              --
              Gabriel Genellina
              Softlab SRL






              _______________ _______________ _______________ _____
              Preguntá. Respondé. Descubrí.
              Todo lo que querías saber, y lo que ni imaginabas,
              está en Yahoo! Respuestas (Beta).
              ¡Probalo ya!


              Comment

              Working...