getkyo / kyo

Toolkit for Scala Development
https://getkyo.io
Apache License 2.0
527 stars 44 forks source link

chunks: avoid ClassTag cache lookup #503

Closed fwbrasil closed 3 months ago

fwbrasil commented 3 months ago

I've been doing some performance testing as part of the work on the new core design and noticed thread contention when using chunks due to ClassTag lookups, which are synchronized by Scala's ClassTag cache. We don't really need the ClassTag lookup since the goal in chunks is to always use Any for internal arrays. I've tried to introduce a benchmark for it but I couldn't reproduce the issue in isolation.

I'm updating both versions in kyo-core and kyo-prelude.