Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@whyoleg
Copy link
Collaborator

@whyoleg whyoleg commented Jan 27, 2025

Found and tested on https://github.com/rjaros/kilua (results are reproducible even after several runs).
Reduces allocations inside DefaultExternalLocationProvider.resolve from 11 GB to 1 GB. Previously packages were recreated for each resolve.
The changes don't really affect kotlinx.io and kotlinx.coroutines.

For future: probably it might make sense to also cache results of DefaultExternalLocationProvider.resolve?
In this specific project there are a lot of references to @Composable annotation passing through this function call.

@whyoleg whyoleg requested a review from vmishenev January 27, 2025 14:14
@whyoleg whyoleg self-assigned this Jan 27, 2025
Copy link
Contributor

@vmishenev vmishenev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably it might make sense to also cache results of DefaultExternalLocationProvider.resolve?

It might, but I'm afraid it could increase maxHeapSize. Anyway, we should assess the potential performance.

@whyoleg whyoleg merged commit 961c677 into master Jan 30, 2025
14 checks passed
@whyoleg whyoleg deleted the whyoleg/perf-packageList branch January 30, 2025 13:25
@whyoleg whyoleg added this to the Dokka 2.1.0 milestone Jul 30, 2025
@whyoleg whyoleg added the perf Performance related label Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf Performance related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants