ShinobuAmasaki / forgex

A Regular Expression Engine written entirely in Fortran
https://shinobuamasaki.github.io/forgex/
MIT License
21 stars 3 forks source link

Timing code #2

Closed jacobwilliams closed 1 week ago

jacobwilliams commented 2 weeks ago

I would suggest a few things about the timing code. I would recommend using some preprocessor directives in the Fortran code to remove the calls to the timing routines unless the user wants them. I think you really only want those for debugging/testing right? Also you can remove the one .c file by making Fortran versions of those QueryPerformanceCounter and QueryPerformanceFrequency stubs.

ShinobuAmasaki commented 2 weeks ago

I completely agree with the part of your suggestion that .c file could be removed using preprocessor directives, and I want to get started on this soon.

Second, you're correct that the calls to the timing routines are intended for testing and debugging. In addition, the command line tool forgex-cli that invokes these routines serves the same purpose. With this in mind, disabling the timing routines with preprocessor directives makes the command loss its main functionality such as timing test. Is this included in your suggestion?

Regarding this, I would really like to have the command line tool's files (and the timing code they call) compiled only during development, but it seems fpm doesn't have the functionality yet to do that...

ShinobuAmasaki commented 1 week ago

I completely agree with the part of your suggestion that .c file could be removed using preprocessor directives, and I want to get started on this soon.

I previously answered like this, but it turned out that it was impossible to build a similar stub code in Fortran due to the constraints of GFortran's predefined macros.

Therefore, starting with version 3.5, the command line tool (including time measurement) code was moved to a separate repository.

cf. ShinobuAmasaki/forgex-cli

As a result of this decision, there is no longer any functionality related to timing code in this repository, and this issue has been resolved.