Skip to content

Enable incremental compilation of klib artifacts - #1925

Open
joreilly wants to merge 1 commit into
mainfrom
kotlin-incremental-native
Open

joreilly wants to merge 1 commit into
mainfrom
kotlin-incremental-native

Conversation

@joreilly

Copy link
Copy Markdown
Owner

Summary

Sets kotlin.incremental.native=true in gradle.properties. This enables incremental compilation of klib artifacts — the klib→binary step of Kotlin/Native — which is Beta as of Kotlin 2.4.20 (Experimental since 1.9.20), and which JetBrains plan to enable by default in a future release.

Measured locally on :shared:linkDebugFrameworkIosSimulatorArm64 (warm daemon, one small source edit before each run, per-task times from Gradle --profile, two interleaved off/on rounds):

n mean median range
off 8 11.06s 10.40s 9.55–14.46s
on (steady state) 7 7.93s 8.04s 7.60–8.26s

~28% off the link task, with tighter variance. The klib compile step (~2.5s) is unchanged, as expected.

Costs:

  • one slower priming link the first time (13.7s vs ~10s) while the IC cache is built
  • ~22MB at shared/build/kotlin-native-ic-cache/debugFramework, per binary, cleared by clean
  • debug binaries only — KotlinNativeLink gates the IC flags behind !optimized, so release/TestFlight links are unaffected

Test plan

  • ./gradlew :shared:linkDebugFrameworkIosSimulatorArm64 green with the flag set
  • IC cache dir confirmed created (shared/build/kotlin-native-ic-cache/debugFramework, 22MB)
  • CI green

🤖 Generated with Claude Code

https://claude.ai/code/session_014VYXf6KbfXuDuHV4uy3id8

Beta as of Kotlin 2.4.20. Measured on :shared:linkDebugFrameworkIosSimulatorArm64
with a one-line source edit per run: link time drops from ~11.1s to ~7.9s mean
(n=8/7), with tighter variance. Costs one slower priming link and ~22MB under
shared/build/kotlin-native-ic-cache. Debug binaries only - release links are
unaffected.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014VYXf6KbfXuDuHV4uy3id8
github-actions Bot added a commit that referenced this pull request Sep 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Preview Changes

Note

Compared against the baseline rendered from 7710024b, which is 3 commit(s) behind this PR's base (3e529026) — the newest baseline published when this ran. Any preview those commits changed is attributed to this PR below. Re-run this check once the baseline for 3e529026 has published to see only this PR's own changes.

Changed (1 variant(s) across 1 function(s))

HomeListViewKotlinConf (wearApp)

Before After
Unchanged (140 function(s), 280 variant(s))
  • AccountIconSignedInPreview
  • AccountIconSignedOutPreview
  • AccountScreenPreview
  • AccountViewSignedInPreview
  • AccountViewSignedOutPreview
  • Android Dark theme
  • Android Light theme
  • AndroidMakers Dark theme
  • AndroidMakers Light theme
  • AndroidMakers theme
  • AndroidSessionDetailPreview
  • AndroidSpeakerDetailsPreview
  • AssistantConversationPreview
  • BackgroundAndroid
  • BackgroundDefault
  • BackgroundDynamic
  • BookmarkAddPreview
  • BookmarkOnPreview
  • BookmarksPreview
  • BookmarksPreviewEmpty
  • BookmarksPreviewError
  • BookmarksPreviewErrorLong
  • BookmarksPreviewLoading
  • BookmarksPreviewLong
  • BookmarksTilePreview
  • BookmarksViewEmptyPreview
  • BookmarksViewLoadedPreview
  • BookmarksViewLoadingPreview
  • ColorSchemeSpecimenPreview
  • Color_0x000080
  • Color_0x000080Swatches
  • Color_0x008000
  • Color_0x008000Swatches
  • Color_0x800000
  • Color_0x800000Swatches
  • ConferenceCardPreview
  • ConferenceHomeScreen
  • ConferenceHomeScreenLoading
  • ConferenceHomeScreenWithBookmarks
  • ConferenceListViewLoadedPreview
  • ConferenceListViewLoadingPreview
  • ConferenceSelectionPreview
  • ConferencesViewCuratedPreview
  • ConferencesViewErrorPreview
  • ConferencesViewLongPreview
  • ConferencesViewPreview
  • Confetti (default) theme
  • Confetti brand Dark theme
  • Confetti brand Light theme
  • ConfettiHeaderPreview
  • DayChipPreview
  • Defaults
  • DefaultsSwatches
  • DevFest Dark theme
  • DevFest Light theme
  • DevFest theme
  • Droidcon Dark theme
  • Droidcon Light theme
  • Droidcon theme
  • Dynamic Dark theme
  • Dynamic Light theme
  • EmptyViewPreview
  • ErrorViewNoRetryPreview
  • ErrorViewWithRetryPreview
  • HazeBottomNavigationDetailPreview
  • HazeBottomNavigationPreview
  • HomeListViewAndroidMakers
  • HomeListViewDevFest
  • HomeListViewDroidcon
  • HomeListViewLongPreview
  • HomeListViewPreview
  • KotlinConf Dark theme
  • KotlinConf Light theme
  • KotlinConf theme
  • LoadingViewPreview
  • LoadingViewWithMessagePreview
  • LoginTilePreview
  • MainActivity
  • NoConferenceTilePreview
  • NotSet
  • NotSetSwatches
  • OnboardingHazePreview
  • OnboardingSignInStepPreview
  • PlaceholderButtonPreview
  • ScheduleScreenPreview
  • ScreenHeaderPreview
  • SearchViewEmptyQueryPreview
  • SearchViewLoadedPreview
  • SearchViewLoadingPreview
  • SectionHeaderPreview
  • SessionCardBookmarkedPreview
  • SessionCardLoadingPreview
  • SessionCardPopulatedPreview
  • SessionDetailViewEmptyPreview
  • SessionDetailViewLoadedPreview
  • SessionDetailViewPreview
  • SessionDetailsPreview
  • SessionDetailsScreen
  • SessionDetailsScreenPreview
  • SessionItemBreakPreview
  • SessionItemLightningPreview
  • SessionItemPopulatedPreview
  • SessionItemViewBreakPreview
  • SessionItemViewLightningPreview
  • SessionItemViewLoadedPreview
  • SessionListGridViewLoadedPreview
  • SessionListGridViewLoadingPreview
  • SessionListViewErrorPreview
  • SessionListViewLoadedPreview
  • SessionListViewLoadingPreview
  • SessionListViewLongPreview
  • SessionListViewPreview
  • SessionSpeakerChipPreview
  • SettingsListViewLongPreview
  • SettingsListViewPreview
  • SettingsScreenPreview
  • SocialIconPreview
  • SpeakerDetailsScreen
  • SpeakerDetailsScreenPreview
  • SpeakerDetailsViewAlternateSpeakerPreview
  • SpeakerDetailsViewLoadedPreview
  • SpeakerDetailsViewPreview
  • SpeakerGridViewEmptyPreview
  • SpeakerGridViewLoadedPreview
  • SpeakerItemPreview
  • SpeakerItemViewLoadedPreview
  • SpeakerItemViewNoTaglinePreview
  • ThemeFoundationAndroidMakersPreview
  • ThemeFoundationAndroidPreview
  • ThemeFoundationConferenceSeedPreview
  • ThemeFoundationConfettiPreview
  • ThemeFoundationCurrentPreview
  • ThemeFoundationDefaultPreview
  • ThemeFoundationDevFestPreview
  • ThemeFoundationDroidconPreview
  • ThemeFoundationDynamicPreview
  • ThemeFoundationKotlinConfPreview
  • TypographySpecimenPreview
  • VenueViewLoadedPreview
  • VenueViewWithFloorPlanPreview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant