From 3f94d1b260808a7a23fa1e2d6e90f2a2d56116ed Mon Sep 17 00:00:00 2001 From: Gerhard Theurich Date: Wed, 25 Sep 2024 17:51:50 +0000 Subject: [PATCH] Small optimizations for large petCounts. --- src/Infrastructure/VM/src/ESMCI_VM.C | 5 +++++ .../StateReconcile/src/ESMF_StateReconcile.F90 | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/Infrastructure/VM/src/ESMCI_VM.C b/src/Infrastructure/VM/src/ESMCI_VM.C index db32a1532f..e609585189 100644 --- a/src/Infrastructure/VM/src/ESMCI_VM.C +++ b/src/Infrastructure/VM/src/ESMCI_VM.C @@ -140,6 +140,10 @@ static bool esmfFinalized = false; #undef ESMC_METHOD #define ESMC_METHOD "ESMCI::VMKeyCompare()" static bool VMKeyCompare(unsigned char *vmKey1, unsigned char *vmKey2){ + if (vmKey1==vmKey2) return true; // quick return for identical pointers +#if 1 + return std::memcmp(vmKey1, vmKey2, vmKeyWidth) == 0; +#else int i; for (i=0; i