Back to index

python3.2  3.2.2
Classes | Functions | Variables
pybench Namespace Reference

Classes

class  Test
 Test baseclass. More...
class  Benchmark
 Benchmark base class. More...
class  PyBenchCmdline

Functions

def get_timer
 Helpers.
def get_machine_details
def print_machine_details

Variables

string __copyright__
 pickle = cPickle
string __version__ = '2.1'
int MILLI_SECONDS = 1
 Constants.
int MICRO_SECONDS = 1
int PERCENT = 100
int LINE = 79
int MIN_TEST_RUNTIME = 1
int CALIBRATION_RUNS = 20
int CALIBRATION_LOOPS = 20
int ALLOW_SKIPPING_CALIBRATION = 1
string TIMER_TIME_TIME = 'time.time'
string TIMER_TIME_CLOCK = 'time.clock'
string TIMER_SYSTIMES_PROCESSTIME = 'systimes.processtime'
 TIMER_PLATFORM_DEFAULT = TIMER_TIME_CLOCK
int _debug = 0

Function Documentation

Definition at line 104 of file pybench.py.

00104 
00105 def get_machine_details():
00106 
00107     if _debug:
00108         print('Getting machine details...')
00109     buildno, builddate = platform.python_build()
00110     python = platform.python_version()
00111     if sys.maxunicode == 65535:
00112         # UCS2 build (standard)
00113         unitype = 'UCS2'
00114     else:
00115         # UCS4 build (most recent Linux distros)
00116         unitype = 'UCS4'
00117     bits, linkage = platform.architecture()
00118     return {
00119         'platform': platform.platform(),
00120         'processor': platform.processor(),
00121         'executable': sys.executable,
00122         'implementation': getattr(platform, 'python_implementation',
00123                                   lambda:'n/a')(),
00124         'python': platform.python_version(),
00125         'compiler': platform.python_compiler(),
00126         'buildno': buildno,
00127         'builddate': builddate,
00128         'unicode': unitype,
00129         'bits': bits,
00130         }

Here is the call graph for this function:

def pybench.get_timer (   timertype)

Helpers.

Definition at line 92 of file pybench.py.

00092 
00093 def get_timer(timertype):
00094 
00095     if timertype == TIMER_TIME_TIME:
00096         return time.time
00097     elif timertype == TIMER_TIME_CLOCK:
00098         return time.clock
00099     elif timertype == TIMER_SYSTIMES_PROCESSTIME:
00100         import systimes
00101         return systimes.processtime
00102     else:
00103         raise TypeError('unknown timer type: %s' % timertype)

def pybench.print_machine_details (   d,
  indent = '' 
)

Definition at line 131 of file pybench.py.

00131 
00132 def print_machine_details(d, indent=''):
00133 
00134     l = ['Machine Details:',
00135          '   Platform ID:    %s' % d.get('platform', 'n/a'),
00136          '   Processor:      %s' % d.get('processor', 'n/a'),
00137          '',
00138          'Python:',
00139          '   Implementation: %s' % d.get('implementation', 'n/a'),
00140          '   Executable:     %s' % d.get('executable', 'n/a'),
00141          '   Version:        %s' % d.get('python', 'n/a'),
00142          '   Compiler:       %s' % d.get('compiler', 'n/a'),
00143          '   Bits:           %s' % d.get('bits', 'n/a'),
00144          '   Build:          %s (#%s)' % (d.get('builddate', 'n/a'),
00145                                           d.get('buildno', 'n/a')),
00146          '   Unicode:        %s' % d.get('unicode', 'n/a'),
00147          ]
00148     joiner = '\n' + indent
00149     print(indent + joiner.join(l) + '\n')

Here is the caller graph for this function:


Variable Documentation

Initial value:
00001 """\
00002 Copyright (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com)
00003 Copyright (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com)
00004 
00005                    All Rights Reserved.
00006 
00007 Permission to use, copy, modify, and distribute this software and its
00008 documentation for any purpose and without fee or royalty is hereby
00009 granted, provided that the above copyright notice appear in all copies
00010 and that both that copyright notice and this permission notice appear
00011 in supporting documentation or portions thereof, including
00012 modifications, that you make.
00013 
00014 THE AUTHOR MARC-ANDRE LEMBURG DISCLAIMS ALL WARRANTIES WITH REGARD TO
00015 THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
00016 FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
00017 INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
00018 FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
00019 NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
00020 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !
00021 """

Definition at line 16 of file pybench.py.

Definition at line 48 of file pybench.py.

Definition at line 88 of file pybench.py.

Definition at line 72 of file pybench.py.

Definition at line 69 of file pybench.py.

Definition at line 66 of file pybench.py.

Definition at line 60 of file pybench.py.

Definition at line 54 of file pybench.py.

Constants.

Definition at line 53 of file pybench.py.

Definition at line 63 of file pybench.py.

Definition at line 57 of file pybench.py.

pybench.pickle = cPickle

Definition at line 43 of file pybench.py.

Definition at line 82 of file pybench.py.

Definition at line 77 of file pybench.py.

Definition at line 76 of file pybench.py.

Definition at line 75 of file pybench.py.