aws / lumberyard

Amazon Lumberyard is a free AAA game engine deeply integrated with AWS and Twitch – with full source.
Other
2.03k stars 540 forks source link

SliceInstantiationTicket hash performance #506

Closed m9co closed 3 years ago

m9co commented 4 years ago

SliceInstantiationTicket is used as bus id in SliceInstantiationResultBus, as result it's used as key for internal hash table and hash function is used extensively when spawning dynamic slices. Current implementation of hash function uses Crc32, which is quite slow - on my PC it takes around 20 microseconds, which can add up to a considerable time loss - single slice spawn causes multiple hash table operations, recalculating hash each time.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

AMZN-alexpete commented 3 years ago

Thanks for submitting this performance boost @m9co ! We're currently evaluating this change.

AMZN-alexpete commented 3 years ago

Hi @m9co , this change has been accepted and will be released in a future version of Lumberyard, thank you!