Uploaded image for project: 'mod_python'
  1. mod_python
  2. MODPYTHON-93

Improve util.FieldStorage efficiency

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.2.7
    • 3.3.1
    • core
    • None

    Description

      Form fields are saved as a list in a FieldStorage class instance. The class implements a _getitem_ method to provide dict-like behaviour. This method iterates over the complete list for every call to _getitem_. Applications that need to access all the fields when processing the form will show O(n^2) behaviour where n == the number of form fields. This overhead could be avoided by creating a dict (to use as an index) when the FieldStorage instance is created.

      Mike Looijmans has been investigating StringField and Field as well. It is probably reasonable to include information on his work in this issue as well, so that we can consider all of these efficiency issues in toto.

      Attachments

        1. modpython325_util_py_dict.patch
          8 kB
          Mike Looijmans

        Activity

          People

            grahamd Graham Phillip Dumpleton
            jgallacher James Paul Gallacher
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: