For those interested, I have just posted a Groovy 'library' (of sorts) that may be helpful to those trying to develop Application or Device Handler code that can run unmodified on both SmartThings and Hubitat. I've spent literall hours testing performance of various approaches, supported by a number of core members of the Hubitat team, to come up with this library.
This SHPL is available (for free) here:
You will find documentation and some sample code in the README file. The code is free to use
Well, SmartThings has so much overhead that checking first for Hubitat almost doubles the execution time. Code running on Hubitat can figure out it is not on SmartThings with far fewer CPU cycles than code running on SmartThings can figure out that it is not on Hubitat.
So, in the interest of optimal performance on both platforms, I intentionally structured the code this way. That said. isHE/state.isHE are far faster on Hubitat than their equivalents on SmartThings.