fparser.scripts.fparser2_bench ============================== .. py:module:: fparser.scripts.fparser2_bench .. autoapi-nested-parse:: 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. Functions --------- .. autoapisummary:: fparser.scripts.fparser2_bench.gen_sub fparser.scripts.fparser2_bench.create_bench fparser.scripts.fparser2_bench.runner Module Contents --------------- .. py:function:: gen_sub(num: int) Constructs a Fortran subroutine named g. :param num: the number of the subroutine (used to name it). :returns: Fortran subroutine. :rtype: str .. py:function:: create_bench(num_routines: int) Creates the Fortran benchmark code. :param num_routines: the number of subroutines to create. :returns: benchmark Fortran code. :rtype: str .. py:function:: runner(num_routines: int) Entry point for running the benchmark. :param num_routines: the number of subroutines to create in the Fortran benchmark. :raises ValueError: if num_routines < 1.