fparser.scripts.fparser2_bench
Generates a large Fortran program in memory and then measures how long it takes fparser2 to parse it. This is based on the benchmark suggested by Ondřej Čertík via Ioannis Nikiteas.
Module Contents
Functions
|
Constructs a Fortran subroutine named g<num>. |
|
Creates the Fortran benchmark code. |
|
Entry point for running the benchmark. |
- fparser.scripts.fparser2_bench.gen_sub(num: int)[source]
Constructs a Fortran subroutine named g<num>.
- Parameters:
num – the number of the subroutine (used to name it).
- Returns:
Fortran subroutine.
- Return type:
- fparser.scripts.fparser2_bench.create_bench(num_routines: int)[source]
Creates the Fortran benchmark code.
- Parameters:
num_routines – the number of subroutines to create.
- Returns:
benchmark Fortran code.
- Return type:
- fparser.scripts.fparser2_bench.runner(num_routines: int)[source]
Entry point for running the benchmark.
- Parameters:
num_routines – the number of subroutines to create in the Fortran benchmark.
- Raises:
ValueError – if num_routines < 1.