librascal icon indicating copy to clipboard operation
librascal copied to clipboard

Tests take too long, cut them down below 10 s in debug

Open tjunge opened this issue 5 years ago • 7 comments

tjunge avatar Sep 18 '19 10:09 tjunge

there has been some dramatic improvements of test time in the feat/interpolator branch by reducing the length parameter in the kernel tests, it is now around twice as fast.

  struct StrictNLCollectionFixture : MultipleStructureManagerNLStrictFixture {
    using Parent = MultipleStructureManagerNLStrictFixture;
    using ManagerTypeHolder_t = typename Parent::ManagerTypeHolder_t;

    StrictNLCollectionFixture() : Parent{} {};

    ~StrictNLCollectionFixture() = default;

    std::string filename{"reference_data/dft-smiles_500.ubjson"};
    int start{4};
    int length{3};
  };

agoscinski avatar Sep 20 '19 12:09 agoscinski

Even if @agoscinski work improves the results here, test runtime in debug is still more than 3 min, so this should stay open.

Luthaf avatar Oct 08 '19 14:10 Luthaf

Sorry, was not intentional. I read it again while commenting and missed the part of the debug and though I only closed my comment, but apparently I closed the issue. Sorry again...

mastricker avatar Oct 08 '19 14:10 mastricker

no problem! =)

Luthaf avatar Oct 08 '19 14:10 Luthaf

Just adding things I see as time consumers here for reference once the works starts:

  • rascal::kernerls_test::multiple_kernel_compute_test
  • rascal::internal::read_binary_file seems to take an awful lot of time for a 300kb file (10% of the test time)
  • nlohmann::detail::binary_reader also another 10%, which redirects to the above
  • rascal::BlockSparseProperty has a large cost implying `std::allocator<std::vector<....>::_M_realloc_insert - could this Property be sized differently in the beginning?

In general: multiple seems to be an issue. Is it possible to cut down on the number of tests with reference data for the spherical expansion?

mastricker avatar Oct 14 '19 08:10 mastricker

Enabling -Og (optimizations that should not interfere with debugging) --- as done in #165 --- brings the test time from 147s to 9s locally.

Else, the biggest offenders are test_calculator (98s at -O0/5s at -Og) and test_kernel (15s at -O0/1s at -Og).

Luthaf avatar Oct 17 '19 10:10 Luthaf

move -Og flag to a new CMAKE_BUILD_TYPE. Suggested name DebugOg

agoscinski avatar Dec 04 '19 10:12 agoscinski