Code

Changes between Version 72 and Version 73 of IrcFAQ


Ignore:
Timestamp:
05/02/08 09:27:30 (6 years ago)
Author:
pbx
Comment:

added performance tuning item

Legend:

Unmodified
Added
Removed
Modified
  • IrcFAQ

    v72 v73  
    7676`null=True` means that the database will accept a `NULL` value for that field; `blank=True` means that Django's validation system won't complain about a missing value. If you use `blank=True` but ''not'' `null=True` you will need to have your code fill in a value before storage in the database -- specifying a default on a field, or putting something in the model's `save` method to generate a value are two good ways to handle this, and can be extremely useful when you want to calculate one field's value based on others. 
    7777 
     78== Which runs faster, X or Y? == #WhichIsFaster 
     79 
     80This is a tempting question to answer in hopes of getting a quick answer on the "best" way to do something. Unfortunately, the answer is generally "profile your app and see". Performance tuning always starts with a baseline. If you haven't measured current performance to get a baseline, you aren't in a position to do much with the answer to the question anyway. 
     81 
     82You can learn more about Python's handy profiling tools in the [http://docs.python.org/lib/profile.html Python documentation]. 
    7883 
    7984= How to do Stuff = #HowTo