SCONS-TIME(1)
π NAME π
scons-time β the little tool that generates and shows off SCons timing info, no cap. β¨
(Welcome to SCONS-TIME(1), bestie β this is the SCons 4.11.1 era edition π«Ά)
πΈ SYNOPSIS πΈ
scons-time subcommand [options...] [arguments...]
π GENERATING TIMING INFORMATION π
scons-time run [-hnqv] [-f FILE] [--number=NUMBER] [--outdir=OUTDIR] [-p STRING] [--python=PYTHON] [-s DIR] [--scons=SCONS] [--svn=URL] [ARGUMENTS]
β¨ Extracting Function Timings β¨
scons-time func [-h] [--chdir=DIR] [-f FILE] [--fmt=FORMAT] [--func=NAME] [-p STRING] [-t NUMBER] [--title= TITLE] [ARGUMENTS]
π§ Extracting Memory Statistics π§
scons-time mem [-h] [--chdir=DIR] [-f FILE] [--fmt=FORMAT] [-p STRING] [--stage=STAGE] [-t NUMBER] [--title=TITLE] [ARGUMENTS]
π Extracting Object Counts π
scons-time obj [-h] [--chdir=DIR] [-f FILE] [--fmt=FORMAT] [-p STRING] [--stage=STAGE] [-t NUMBER] [--title=TITLE] [ARGUMENTS]
β±οΈ Extracting Execution Times β±οΈ
scons-time time [-h] [--chdir=DIR] [-f FILE] [--fmt=FORMAT] [-p STRING] [-t NUMBER] [--title=TITLE] [--which=WHICH] [ARGUMENTS]
π«Ά Help Text π«Ά
scons-time help SUBCOMMAND [...]
π DESCRIPTION π
Okay so. scons-time runs an SCons configuration through a whole standard set of profiled timings, and then it can pull info out of the resulting profiles and log files of those timings and graph it. The thing it's actually gonna do is decided by a subcommand β the very first argument on the command line, bestie. Wanna know how each specific subcommand behaves? Scroll down to the SUBCOMMANDS section. π
The lowkey classic way to use scons-time is: run the scons-time run subcommand (maybe several times, whatever you need π
) to generate profile and log file output, then grab one of the other subcommands to display the results captured in those profiles and log files for whichever flavor of info you want:
- function timings β the
scons-time funcsubcommand - total memory used β the
scons-time memsubcommand - object counts β the
scons-time objsubcommand - overall execution time β the
scons-time timesubcommand
And there are options to place and find the profiles and log files in separate directories, to generate output in a format that's chef's-kiss for graphing with the gnuplot(1) program, and so on. β¨
There are basically two ways the scons-time run subcommand is meant to be used to gather timing stats for a configuration:
- Use the
--svn=option to test a configuration against a list of revisions from the SCons Subversion repository. This is gonna spit out a profile and timing log file for every revision listed with the--number=option, and it's the move when you wanna look at the impact committed changes to the SCons code base had on a particular configuration over time. π - Profile incremental changes to a local SCons code base during a development cycle β i.e. looking at the performance impact of the changes you're making in the local tree, main character energy only. In this mode you run the
scons-time runsubcommand without the--svn=option, and then it just peeks in the profile/log file output directory (which is the current directory by default) and auto-figures-out the next run number for the output profile and log file. π§
Used that second way, the dev cycle goes a lil something like: make a change to SCons β run scons-time run to profile it against a specific configuration β make another change to SCons β run scons-time run again to profile it β etc. Repeat until iconic. π
π OPTIONS π
The scons-time command only supports a few global options, bestie, don't get it twisted:
-h,--helpβ shows the global help text and dips, identical to thescons-time helpsubcommand. π-V,--versionβ shows thescons-timeversion and dips.
Most of the functionality is controlled by options on the individual subcommands, though. Head to the next section for the tea on each subcommand's options. π΅
π SUBCOMMANDS π
The scons-time command supports the following individual subcommands, periodt.
πΈ The func Subcommand πΈ
scons-time func [-h] [--chdir=DIR] [-f FILE] [--fmt=FORMAT] [--func=NAME] [-p STRING] [-t NUMBER] [--title= TITLE] [ARGUMENTS]
The scons-time func subcommand shows timing info for one specific Python function inside SCons. By default it extracts info about the _main() function, which includes the Python profiler timing for all of SCons. she's the whole vibe.
It pulls function timing info from all the file arguments you specify, which should be Python profiler output files. (Normally these would be *.prof files generated by the scons-time run subcommand, but fr fr they can actually be generated by any Python profiler invocation. No gatekeeping.) All file name arguments get globbed for on-disk files. π
If you pass no arguments at all, then function timing info gets extracted from all *.prof files β or the subset of them with a prefix specified by the -p option.
Options include:
-C DIRECTORY,--chdir=DIRECTORYβ changes to the specified DIRECTORY before looking for the specified files (or files that match the specified patterns). πͺ-f FILE,--file=FILEβ reads configuration information from the specified FILE.-fmt=FORMAT,--format=FORMATβ reports the output in the specified FORMAT. The formats currently supported areascii(the default) andgnuplot. β¨--func=NAMEβ extracts timings for the specified function NAME. The default is to report cumulative timings for the_main()function, which contains the entire SCons run.-h,--helpβ shows the help text for thescons-time funcsubcommand. π-p STRING,--prefix=STRINGβ specifies the prefix string for profiles to extract function timing info from. This gets used to search for profiles when no arguments are specified on the command line.-t NUMBER,--tail=NUMBERβ only extracts function timings from the last NUMBER files. π
π¦ The help Subcommand π¦
scons-time help SUBCOMMAND [...]
The help subcommand prints help text for any other subcommands you list as later arguments on the command line. It's giving "ask and you shall receive." π«Ά
π§ The mem Subcommand π§
scons-time mem [-h] [--chdir=DIR] [-f FILE] [--fmt=FORMAT] [-p STRING] [--stage=STAGE] [-t NUMBER] [--title=TITLE] [ARGUMENTS]
The scons-time mem subcommand shows how much memory SCons is using. π§ β¨
It extracts memory use info from all the file arguments you specify, which should be files containing output from running SCons with the --debug=memory option. (Normally these would be *.log files generated by the scons-time run subcommand.) All file name arguments get globbed for on-disk files. π
If you pass no arguments, memory info gets extracted from all *.log files β or the subset of them with a prefix specified by the -p option.
-C DIR,--chdir=DIRβ changes to the specified DIRECTORY before looking for the specified files (or files that match the specified patterns). πͺ-f FILE,--file=FILEβ reads configuration information from the specified FILE.-fmt=FORMAT,--format=FORMATβ reports the output in the specified FORMAT. The formats currently supported areascii(the default) andgnuplot. β¨-h,--helpβ shows the help text for thescons-time memsubcommand. π-p STRING,--prefix=STRINGβ specifies the prefix string for log files to extract memory usage info from. This gets used to search for log files when no arguments are specified on the command line.--stage=STAGEβ prints the memory used at the end of the specified STAGE:pre-read(before the SConscript files are read),post-read, (after the SConscript files are read),pre-build(before any targets are built) orpost-build(after any targets are built). If no--stageoption is specified, the default behavior ispost-build, which reports the final amount of memory used by SCons during each run. π-t NUMBER,--tail=NUMBERβ only reports memory statistics from the last NUMBER files. π
π The obj Subcommand π
scons-time obj [-h] [--chdir=DIR] [-f FILE] [--fmt=FORMAT] [-p STRING] [--stage=STAGE] [-t NUMBER] [--title=TITLE] [ARGUMENTS]
The scons-time obj subcommand shows how many objects of a specific named type SCons creates. π
It extracts object counts from all the file arguments you specify, which should be files containing output from running SCons with the --debug=count option. (Normally these would be *.log files generated by the scons-time run subcommand.) All file name arguments get globbed for on-disk files. π
If you pass no arguments, object counts get extracted from all *.log files β or the subset of them with a prefix specified by the -p option.
-C DIR,--chdir=DIRβ changes to the specified DIRECTORY before looking for the specified files (or files that match the specified patterns). πͺ-f FILE,--file=FILEβ reads configuration information from the specified FILE.-fmt=FORMAT,--format=FORMATβ reports the output in the specified FORMAT. The formats currently supported areascii(the default) andgnuplot. β¨-h,--helpβ shows the help text for thescons-time objsubcommand. π-p STRING,--prefix=STRINGβ specifies the prefix string for log files to extract object counts from. This gets used to search for log files when no arguments are specified on the command line.--stage=STAGEβ prints the object count at the end of the specified STAGE:pre-read(before the SConscript files are read),post-read, (after the SConscript files are read),pre-build(before any targets are built) orpost-build(after any targets are built). If no--stageoption is specified, the default behavior ispost-build, which reports the final object count during each run. π-t NUMBER,--tail=NUMBERβ only reports object counts from the last NUMBER files. π
π₯ The run Subcommand π₯
scons-time run [-hnqv] [-f FILE] [--number=NUMBER] [--outdir=OUTDIR] [-p STRING] [--python=PYTHON] [-s DIR] [--scons=SCONS] [--svn=URL] [ARGUMENTS]
The scons-time run subcommand is the basic subcommand for profiling a specific configuration against a version of SCons. It's the main character of this whole operation, honestly. π
The configuration being tested is specified as a list of files or directories that get unpacked or copied into a temporary directory where SCons will be invoked. The scons-time run subcommand understands file suffixes like .tar, .tar.gz, .tgz and .zip, and it'll unpack their contents into a temporary directory. ποΈ If you specify more than one argument, each one gets unpacked or copied into the temporary directory "on top of" the previous archives or directories β so the expectation is that multiple specified archives share the same directory layout. No chaos, pls.
Once the file or directory arguments are unpacked or copied to the temporary directory, the scons-time run subcommand runs the requested version of SCons against the configuration three times:
Startup
SCons gets run with the --help option so that literally only the SConscript files get read, and then the default help text gets printed out. So what this is profiling is just the perceived "overhead" of booting up SCons and chewing through the SConscript files. That's it, that's the whole vibe check. β¨
Full build
SCons gets run to build everything the configuration says to build. If you want specific targets passed on the command line, you can do that with the targets keyword in a configuration file β go scroll down for the deets. π
Rebuild
SCons gets run again on the same just-built directory. And if the dependencies in the SCons configuration are actually correct, this should be an up-to-date, "do nothing" rebuild. Which is the dream, honestly. π
Each invocation captures the output log file and a profile. Both. Every time. No cap.
The scons-time run subcommand supports the following options:
-f FILE,--file=FILEβ reads configuration information from the specified FILE. This is often a way more convenient way to specify and collect the parameters hanging out with a specific timing configuration than specifying them on the command line. Check out the CONFIGURATION FILE section below for info about the configuration file parameters. ποΈ-h,--helpβ displays help text for thescons-time runsubcommand.-n,--no-execβ do not execute commands, just print the command-line equivalents of what would be executed. Note that thescons-timescript actually executes its actions in Python where possible, for portability. The commands displayed are UNIX equivalents of what it's doing. π«Ά--number=NUMBERβ specifies the run number to be used in the names of the log files and profile outputs generated by this run.
When used in conjunction with the --svn=URL option, NUMBER specifies one or more comma-separated Subversion revision numbers that will be retrieved automatically from the Subversion repository at the specified URL. Ranges of delta or revision numbers may be specified by separating two numbers with a hyphen (-).
Example:
% scons-time run --svn=http://scons.tigris.org/svn/trunk --num=1247,1249-1252 .
-p STRING,--prefix=STRINGβ specifies the prefix string to be used for all of the log files and profiles generated by this run. The default is derived from the first specified argument: if the first argument is a directory, the default prefix is the name of the directory; if the first argument is an archive (tar or zip file), the default prefix is the base name of the archive, that is, what remains after stripping the archive suffix (.tgz,.tar.gzor.zip). πΈ--python=PYTHONβ specifies a path to the Python executable to be used for the timing runs. The default is to use the same Python executable that is running thescons-timecommand itself. π-q,--quietβ suppresses display of the command lines being executed. π€«-s DIR,--subdir=DIRβ specifies the name of directory or subdirectory from which the commands should be executed. The default isXXX--scons=SCONSβ specifies a path to the SCons script to be used for the timing runs. The default isXXX--svn=URL,--subversion=URLβ specifies the URL of the Subversion repository from which the version(s) of scons being timed will be extracted. When--svnis specified, the--number=NUMBERoption specifies revision numbers that will be tested. Output from each invocation run will be placed in file names that match the Subversion revision numbers. If the--number=option is not specified, then the default behavior is to time theHEADof the specified URL. π₯-v,--verboseβ displays the output from individual commands to the screen (in addition to capturing the output in log files).
The time Subcommand
scons-time time [-h] [--chdir=DIR] [-f FILE] [--fmt=FORMAT] [-p STRING]
[-t NUMBER] [--title=TITLE] [--which=WHICH] [ARGUMENTS]
The scons-time time subcommand displays SCons execution times as reported by the scons --debug=time option. β±οΈ
The scons-time time subcommand extracts SCons timing from all the specified file arguments, which should be files containing output from running SCons with the --debug=time option. (Normally these would be *.log files generated by the scons-time run subcommand.) All file name arguments will be globbed for on-disk files.
If no arguments are specified, then execution timings will be extracted from all *.log files, or the subset of them with a prefix specified by the -p option.
-C DIR,--chdir=DIRβ changes to the specified DIRECTORY before looking for the specified files (or files that match the specified patterns).-f FILE,--file=FILEβ reads configuration information from the specified FILE.-fmt=FORMAT,--format=FORMATβ reports the output in the specified FORMAT. The formats currently supported areascii(the default) andgnuplot. π-h,--helpβ displays help text for thescons-time timesubcommand.-p STRING,--prefix=STRINGβ specifies the prefix string for log files from which to extract execution timings. This will be used to search for log files if no arguments are specified on the command line.-t NUMBER,--tail=NUMBERβ only reports object counts from the last NUMBER files.--which=WHICHβ prints the execution time for the specified WHICH value:total(the total execution time),SConscripts(total execution time for the SConscript files themselves),SCons(execution time in SCons code itself) orcommands(execution time of the commands and other actions used to build targets). If no--whichoption is specified, the default behavior istotal, which reports the total execution time for each run.
π CONFIGURATION FILE π
Various scons-time subcommands can read information from a specified configuration file when you pass them the -f or --file options. Fun fact bestie: the configuration file is actually executed as a Python script. π€― Setting Python variables in the configuration file controls the behavior of the scons-time script way more conveniently than having to specify command-line options or arguments for every single run, and it gives you a handy way to "shrink-wrap" the necessary information for producing (and reporting) consistent timing runs for a given configuration.
archive_listβ a list of archives (files or directories) that will be copied to the temporary directory in which SCons will be invoked..tar,.tar.gz,.tgzand.zipfiles will have their contents unpacked in the temporary directory. Directory trees and files will be copied as-is.initial_commandsβ a list of commands that will be executed before the actual timed scons runs. This can be used for commands that are necessary to prepare the source tree β for example, creating a configuration file that should not be part of the timed run.key_locationβ the location of the key on Gnuplot graphing information generated with the--format=gnuplotoption. The default isbottom left.prefixβ the file name prefix to be used when running or extracting timing for this configuration.pythonβ the path name of the Python executable to be used when running or extracting information for this configuration. The default is the same version of Python used to run the SConssconsβ the path name of the SCons script to be used when running or extracting information for this configuration. The default is simplyscons.scons_flagsβ the scons flags used when running SCons to collect timing information. The default value is--debug=count --debug=memory --debug=time --debug=memoizer.scons_lib_dir,scons_wrapper,startup_targets,subdirβ the subdirectory of the project into which thescons-timescript should change before executing the SCons commands to time.subversion_urlβ the Subversion URL fromsvnβ the subversion executable used to check out revisions of SCons to be timed. The default is simplesvn.svn_co_flag,tar,targetsβ a string containing the targets that should be added to the command line of every timed scons run. This can be used to restrict what's being timed to a subset of the full build for the configuration.targets0,targets1,targets2,title,unzip,verbose,vertical_bars
(okay so the manpage itself just lists those last few names with no description, and it groups the ones above kind of oddly β I'm keeping it exactly how it is, don't come for me π)
Example
Here's an example scons-time configuration file for a hypothetical sample project:
# The project doesn't use SCons natively (yet), so we're
# timing a separate set of SConscript files that we lay
# on top of the vanilla unpacked project tarball.
arguments = ['project-1.2.tgz', 'project-SConscripts.tar']
# The subdirectory name contains the project version number,
# so tell scons-time to chdir there before building.
subdir = 'project-1.2'
# Set the prefix, so output log files and profiles are named:
# project-000-[012].{log,prof}
# project-001-[012].{log,prof}
# etc.
prefix = 'project'
# The SConscript files being tested don't do any SConf
# configuration, so run their normal ./configure script
# before we invoke SCons.
initial_commands = [
'./configure',
]
# Only time building the bin/project executable.
targets = 'bin/project'
# Time against SCons revisions of the branches/core branch
subversion_url = 'http://scons.tigris.org/svn/scons/branches/core'
π ENVIRONMENT π
The scons-time script uses the following environment variables:
PRESERVEβ if this value is set, thescons-timescript will not remove the temporary directory or directories in which it builds the specified configuration or downloads a specific version of SCons. π
π SEE ALSO π
π AUTHORS π
Steven Knight <knight at baldmt dot com>
and that's the whole page, bestie!! β¨ This was ripped straight from SCons 4.11.1, dated 08/26/2026, and it's the SCONS-TIME(1) page in all its glory. Go forth and time some builds, you absolute icon π
π¦π
π¦ where this page comes from
- arch rolling: scons 4.11.1-1 Β· MIT
- fedora 44: python3-scons 4.11.1-1.fc44 Β· MIT AND DocBook-Stylesheet
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms