Much of what happens within Defold is driven via its asynchronous message loop. Some of the messages can be quite frequent - e.g. trigger_response, animation_done etc. Given that message dispatch requires the incoming message_id to be compared against a hashed string value, e.g. hash(trigger_response) would there be any mileage in pre-calculating the hashes rather than doing hash(ā¦) each time?
Once again, this question follows on from a previous one and my penchant for avoiding globals, orphaned constants, repeated calculations etc in my code.
As @britzl has indicated in his response to this question, Defold likes to know as much as possible about the game in advance in order to optimize its compilation. If everything is being done in that same vein it is not inconceivable that the Defold compiler is detecting message_id == āstringā comparisions and silently replacing them with message_id == pre_calcuated_hash anyway in which case my own efforts in that direction are superfluous?