Re: Commented: (MODPYTHON-93) Improve util.FieldStorage
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Re: Commented: (MODPYTHON-93) Improve util.FieldStorage




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: Commented: (MODPYTHON-93) Improve util.FieldStorage  
Gregory (Grisha) Trubetskoy


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-27-05 07:46 AM



Having looked at the FieldStorage code, I'm guessing the idea was that you
parse fields as they come in and append them to a list. This preserves
the original order of fields, in case it is needed.

I'm not sure that maintaining a dictionary alongside the list is the right
thing to do. It might be, but there are some difficult questions to answer
-e.g. how costly is a sequential search, and is the code complexity (and
fieldstorage code is no picnic to read as it is) worth the speedup?

Also while it would speed up retrieval, it will slow down the "write"
operation - when a field is added to fieldstorage you now need to append
it to the list, AND check whether it exists in the dictionary, then add it
there as well.

How often do developers access form fields via __getitem__?  I noticed the
publisher does not use it - it iterates the list, so nothing would be
gained there.

Also, something else to consider - is there a simple programatic solution
that could be documented, e.g. something like

my_fs = util.FieldStorage(req)

dict_fs = {}
dict_fs.update(my_fs)

[have no idea whether this will work :-)]

and voila - you've got a dictionary based fieldstorage?

Anyway, just a few cents from me.

Grisha






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 08:04 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register