Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Python optimization

Name: Anonymous 2010-12-01 21:11

Sup /prog/

I'm making a database search CGI script, and it's kind of slow. I've gotten rid of the function re-evals in my for loops, but I want to make it faster.

The question I have is: I have a lot of columns that are in the background that are used in the search, but they aren't seen on the user end, so when I go through my dictionary I have a huge ass IF statement with like 20 ORs. Is it more efficient to have this one if statement? or is it more efficent to just remove the keys from the dictionary before hand?

Name: Anonymous 2010-12-01 23:28

Yes.

Name: Anonymous 2010-12-02 0:01

Why don't you profile it, ``faggot''?

Name: Anonymous 2010-12-03 16:46

>>1
Why don't you google for Python optimization?
I know that there's docs about this.

Don't change these.
Name: Email:
Entire Thread Thread List