The new OUnit test framework invokes Gc.full_major () after each test when the function OUnit.perform_test is used to call tests (see this line of OUnitRunner and this line of OUnit where conf is created). This negatively impacts performance if huge data structures are created outside of test functions (see this kata: https://www.codewars.com/kata/60cc93db4ab0ae0026761232/ocaml).
It is possible to turn off the garbage collection step by setting the property OUnitRunner.run_gc_full_major to false. But I don't see any way to change the default configuration when OUnit.perform_test is used. It seems to be necessary to call OUnitCore.perform_test directly with an appropriate configuration.
The new OUnit test framework invokes
Gc.full_major ()after each test when the functionOUnit.perform_testis used to call tests (see this line ofOUnitRunnerand this line ofOUnitwhereconfis created). This negatively impacts performance if huge data structures are created outside of test functions (see this kata: https://www.codewars.com/kata/60cc93db4ab0ae0026761232/ocaml).It is possible to turn off the garbage collection step by setting the property
OUnitRunner.run_gc_full_majortofalse. But I don't see any way to change the default configuration whenOUnit.perform_testis used. It seems to be necessary to callOUnitCore.perform_testdirectly with an appropriate configuration.