1

I noticed that CRM_Core_OptionGroup::getValue is deprecated - though still used fairly extensively in the codebase. It is noted that values are not cached.

Presumably the preferred function is CRM_Core_PseudoConstant::getKey, but this function actually seems to be slower? What are the advantages of this over the deprecated function?

2
  • Did you measure how slower it was? just curious
    – Xavier
    Jan 14, 2016 at 8:02
  • On a single run it's ~10x slower. However if you loop the call multiple times (more than ~30) then it starts outperforming, presumably due to the caching! It's 2x faster over 10,000 runs. So I suppose that answers my own question in part...
    – John
    Jan 14, 2016 at 16:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.