Msg.post() on Every Step?

I implemented your example and see similar results to the pre-hash. Note I’ve had to remove the print() everywhere because with thousands of messages that becomes the bottleneck rather than anything else.

Attaching the updated project - the old one had a mistake in it.

msg_hash_test.zip (6.6 KB)

Trying my best to eyeball the results, I get the below. You can ignore the actual numbers in my previous post as they were tainted by the mistake in my project.

Messaging “five”, 10k messages per update():
No hash: 2ms
Pre-hash: 0.75ms
Hash lookup: 0.5-1ms

Messaging “one”, 10k messages per update():
No hash: 0.5-1ms
Pre-hash: 0.2-0.3ms
Hash lookup: 0.6-1ms

Interestingly your theory seems to be correct - the lookup is consistent, and is slower than the first pre-hash but faster than the last one.

6 Likes