blob: d28a7673002b49aaa6e90cb35410d147b4304b15 [file] [log] [blame]
Kristján Valur Jónsson7a0da192007-04-30 15:17:46 +00001@echo off
2rem A batch program to build PGO (Profile guided optimization) by first
3rem building instrumented binaries, then running the testsuite, and
4rem finally building the optimized code.
5rem Note, after the first instrumented run, one can just keep on
6rem building the PGUpdate configuration while developing.
7
8setlocal
9set platf=Win32
10
11rem use the performance testsuite. This is quick and simple
Christian Heimesd9fbab22008-01-02 17:43:40 +000012set job1=..\..\tools\pybench\pybench.py -n 1 -C 1 --with-gc
13set path1=..\..\tools\pybench
Kristján Valur Jónsson7a0da192007-04-30 15:17:46 +000014
15rem or the whole testsuite for more thorough testing
Christian Heimesd9fbab22008-01-02 17:43:40 +000016set job2=..\..\lib\test\regrtest.py
17set path2=..\..\lib
Kristján Valur Jónsson7a0da192007-04-30 15:17:46 +000018
19set job=%job1%
20set clrpath=%path1%
21
22:CheckOpts
23if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
24if "%1"=="-2" (set job=%job2%) & (set clrpath=%path2%) & shift & goto CheckOpts
25
Christian Heimesd9fbab22008-01-02 17:43:40 +000026set PGI=%platf%-pgi
27set PGO=%platf%-pgo
Kristján Valur Jónsson7a0da192007-04-30 15:17:46 +000028
29@echo on
30rem build the instrumented version
Christian Heimesd9fbab22008-01-02 17:43:40 +000031call build -p %platf% -c PGInstrument
Kristján Valur Jónsson7a0da192007-04-30 15:17:46 +000032
33rem remove .pyc files, .pgc files and execute the job
Christian Heimesd9fbab22008-01-02 17:43:40 +000034%PGI%\python.exe rmpyc.py %clrpath%
35del %PGI%\*.pgc
36%PGI%\python.exe %job%
Kristján Valur Jónsson7a0da192007-04-30 15:17:46 +000037
38rem finally build the optimized version
Christian Heimesd9fbab22008-01-02 17:43:40 +000039if exist %PGO% del /s /q %PGO%
40call build -p %platf% -c PGUpdate
41