mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 14:20:35 +01:00
[PR #831] Delay instantiation of cachedValues to save memory
#766
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/831
Author: @holzensp
Created: 11/27/2024
Status: 🔄 Open
Base:
main← Head:nullCaches📝 Commits (1)
c431327Delay instantiation ofcachedValuesto save memory📊 Changes
7 files changed (+46 additions, -18 deletions)
View changed files
📝
pkl-core/src/main/java/org/pkl/core/runtime/VmDynamic.java(+12 -4)📝
pkl-core/src/main/java/org/pkl/core/runtime/VmFunction.java(+5 -0)📝
pkl-core/src/main/java/org/pkl/core/runtime/VmListing.java(+1 -1)📝
pkl-core/src/main/java/org/pkl/core/runtime/VmListingOrMapping.java(+3 -0)📝
pkl-core/src/main/java/org/pkl/core/runtime/VmMapping.java(+1 -1)📝
pkl-core/src/main/java/org/pkl/core/runtime/VmObject.java(+18 -12)📝
pkl-core/src/main/java/org/pkl/core/runtime/VmObjectLike.java(+6 -0)📄 Description
I'm putting this up as a discussion piece, more than anything. Wins are minimal, at best.
The thinking was that every
VmObjectgets itscachedValuesinitialised by default, but only the ones that are forced get those values filled. However,cachedValues.entriesisnullby default. There appears to be a bigger possible win to address the fact that a lot ofEconomicMaps haveentriesbe an oversized array (Object[8]by default).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.