mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-04 21:54:27 +08:00
* Add many new c++ catch2 performance benchmarks. * inline splitmix64 from boost, splitmix64 is not always available in boost. fun fact, this version is ~twice as fast * reduce intensity of memory pressure test, target 200MB usage. * new bench compound; accept suggestion from code review * bench MolToCXSmiles * Update Code/Bench/stereo.cpp * impl first part of the suggestions from code reveiw * impl second part of the suggestions from code reveiw
32 lines
784 B
C++
32 lines
784 B
C++
#include <catch2/catch_all.hpp>
|
|
#include <string>
|
|
|
|
#include "bench_common.hpp"
|
|
|
|
#include <GraphMol/SmilesParse/SmilesParse.h>
|
|
#include <GraphMol/Descriptors/Lipinski.h>
|
|
|
|
using namespace RDKit;
|
|
|
|
TEST_CASE("Descriptors::calcNumSpiroAtoms", "[descriptors]") {
|
|
auto samples = bench_common::load_samples();
|
|
BENCHMARK("Descriptors::calcNumSpiroAtoms") {
|
|
auto sum = 0;
|
|
for (auto &mol : samples) {
|
|
sum += Descriptors::calcNumSpiroAtoms(mol);
|
|
}
|
|
return sum;
|
|
};
|
|
}
|
|
|
|
TEST_CASE("Descriptors::calcNumBridgeheadAtoms", "[descriptors]") {
|
|
auto samples = bench_common::load_samples();
|
|
BENCHMARK("Descriptors::calcNumBridgeheadAtoms") {
|
|
auto sum = 0;
|
|
for (auto &mol : samples) {
|
|
sum += Descriptors::calcNumBridgeheadAtoms(mol);
|
|
}
|
|
return sum;
|
|
};
|
|
}
|