mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +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
26 lines
694 B
C++
26 lines
694 B
C++
#include <catch2/catch_all.hpp>
|
|
#include <string>
|
|
|
|
#include "bench_common.hpp"
|
|
|
|
#include <GraphMol/SmilesParse/SmilesParse.h>
|
|
#include <GraphMol/Fingerprints/MorganGenerator.h>
|
|
|
|
using namespace RDKit;
|
|
|
|
TEST_CASE("MorganFingerprints::getFingerprint", "[fingerprint]") {
|
|
auto samples = bench_common::load_samples();
|
|
const auto radius = 2;
|
|
std::unique_ptr<FingerprintGenerator<uint64_t>> gen(
|
|
MorganFingerprint::getMorganGenerator<uint64_t>(radius));
|
|
|
|
BENCHMARK("MorganFingerprints::getFingerprint") {
|
|
auto sum = 0;
|
|
for (auto &mol : samples) {
|
|
std::unique_ptr<ExplicitBitVect> fp(gen->getFingerprint(mol));
|
|
sum += fp->getNumOnBits();
|
|
}
|
|
return sum;
|
|
};
|
|
}
|