Kristján Valur Jónsson | 7a0da19 | 2007-04-30 15:17:46 +0000 | [diff] [blame] | 1 | @echo off
|
| 2 | rem A batch program to build PGO (Profile guided optimization) by first
|
| 3 | rem building instrumented binaries, then running the testsuite, and
|
| 4 | rem finally building the optimized code.
|
| 5 | rem Note, after the first instrumented run, one can just keep on
|
| 6 | rem building the PGUpdate configuration while developing.
|
| 7 |
|
| 8 | setlocal
|
| 9 | set platf=Win32
|
| 10 |
|
| 11 | rem use the performance testsuite. This is quick and simple
|
Christian Heimes | d9fbab2 | 2008-01-02 17:43:40 +0000 | [diff] [blame^] | 12 | set job1=..\..\tools\pybench\pybench.py -n 1 -C 1 --with-gc
|
| 13 | set path1=..\..\tools\pybench
|
Kristján Valur Jónsson | 7a0da19 | 2007-04-30 15:17:46 +0000 | [diff] [blame] | 14 |
|
| 15 | rem or the whole testsuite for more thorough testing
|
Christian Heimes | d9fbab2 | 2008-01-02 17:43:40 +0000 | [diff] [blame^] | 16 | set job2=..\..\lib\test\regrtest.py
|
| 17 | set path2=..\..\lib
|
Kristján Valur Jónsson | 7a0da19 | 2007-04-30 15:17:46 +0000 | [diff] [blame] | 18 |
|
| 19 | set job=%job1%
|
| 20 | set clrpath=%path1%
|
| 21 |
|
| 22 | :CheckOpts
|
| 23 | if "%1"=="-p" (set platf=%2) & shift & shift & goto CheckOpts
|
| 24 | if "%1"=="-2" (set job=%job2%) & (set clrpath=%path2%) & shift & goto CheckOpts
|
| 25 |
|
Christian Heimes | d9fbab2 | 2008-01-02 17:43:40 +0000 | [diff] [blame^] | 26 | set PGI=%platf%-pgi
|
| 27 | set PGO=%platf%-pgo
|
Kristján Valur Jónsson | 7a0da19 | 2007-04-30 15:17:46 +0000 | [diff] [blame] | 28 |
|
| 29 | @echo on
|
| 30 | rem build the instrumented version
|
Christian Heimes | d9fbab2 | 2008-01-02 17:43:40 +0000 | [diff] [blame^] | 31 | call build -p %platf% -c PGInstrument
|
Kristján Valur Jónsson | 7a0da19 | 2007-04-30 15:17:46 +0000 | [diff] [blame] | 32 |
|
| 33 | rem remove .pyc files, .pgc files and execute the job
|
Christian Heimes | d9fbab2 | 2008-01-02 17:43:40 +0000 | [diff] [blame^] | 34 | %PGI%\python.exe rmpyc.py %clrpath%
|
| 35 | del %PGI%\*.pgc
|
| 36 | %PGI%\python.exe %job%
|
Kristján Valur Jónsson | 7a0da19 | 2007-04-30 15:17:46 +0000 | [diff] [blame] | 37 |
|
| 38 | rem finally build the optimized version
|
Christian Heimes | d9fbab2 | 2008-01-02 17:43:40 +0000 | [diff] [blame^] | 39 | if exist %PGO% del /s /q %PGO%
|
| 40 | call build -p %platf% -c PGUpdate
|
| 41 |
|