I'm putting this up as a discussion piece, more than anything. Wins are minimal, at best.
The thinking was that every VmObject gets its cachedValues initialised by default, but only the ones that are forced get those values filled. However, cachedValues.entries is null by default. There appears to be a bigger possible win to address the fact that a lot of EconomicMaps have entries be an oversized array (Object[8] by default).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/apple/pkl/pull/831
**Author:** [@holzensp](https://github.com/holzensp)
**Created:** 11/27/2024
**Status:** 🔄 Open
**Base:** `main` ← **Head:** `nullCaches`
---
### 📝 Commits (1)
- [`c431327`](https://github.com/apple/pkl/commit/c4313273517bb0e22abc859f6d05abc5135bf82d) Delay instantiation of `cachedValues` to save memory
### 📊 Changes
**7 files changed** (+46 additions, -18 deletions)
<details>
<summary>View changed files</summary>
📝 `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)
</details>
### 📄 Description
I'm putting this up as a discussion piece, more than anything. Wins are minimal, at best.
The thinking was that every `VmObject` gets its `cachedValues` initialised by default, but only the ones that are forced get those values filled. However, `cachedValues.entries` is `null` by default. There appears to be a bigger possible win to address the fact that a lot of `EconomicMap`s have `entries` be an oversized array (`Object[8]` by default).
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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.