You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "shuwenwei (via GitHub)" <gi...@apache.org> on 2026/08/12 06:15:45 UTC

[PR] fix: reuse pre-computed ArrayList instance size in AlignedTVList ram cost [iotdb]

shuwenwei opened a new pull request, #18452:
URL: https://github.com/apache/iotdb/pull/18452

   ## Motivation
   
   On the write path, `AlignedTVList.getRamSize()` is called twice per `insertTablet` (pre-write snapshot + post-write reconciliation). `calculateContainerRamCost()` calls `RamUsageEstimator.shallowSizeOf(list)` for every `ArrayList` in the N-wide containers, which performs reflective layout computation on each call.
   
   An async-profiler flame graph confirmed that within `DataRegion.insertTablet`, the `getRamSize` chain accounts for a significant share of CPU time, and the self time is almost entirely in `RamUsageEstimator.shallowSizeOfInstance`.
   
   ## Change
   
   Replace the per-call `RamUsageEstimator.shallowSizeOf(list)` with the pre-computed constant `MemoryEstimationHelper.ARRAY_LIST_INSTANCE_SIZE` in `listRamCostWithReferences` and `listRamCostWithoutReferences`.
   
   All lists passed to these helpers (`dataTypes`, `timestamps`, `indices`, `values`, `bitMaps` and their inner lists) are `ArrayList` instances, so the constant is exactly equal to `shallowSizeOf` for them and the accounting result is unchanged.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: reuse pre-computed ArrayList instance size in AlignedTVList ram cost [iotdb]

Posted by "JackieTien97 (via GitHub)" <gi...@apache.org>.
JackieTien97 merged PR #18452:
URL: https://github.com/apache/iotdb/pull/18452


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: reuse pre-computed ArrayList instance size in AlignedTVList ram cost [iotdb]

Posted by "sonarqubecloud[bot] (via GitHub)" <gi...@apache.org>.
sonarqubecloud[bot] commented on PR #18452:
URL: https://github.com/apache/iotdb/pull/18452#issuecomment-5263139932

   ## [![Quality Gate Failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-failed-20px.png 'Quality Gate Failed')](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=18452) **Quality Gate failed**  
   Failed conditions  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [B Security Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=18452) (required ≥ A)  
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/failed-16px.png '') [E Reliability Rating on New Code](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=18452) (required ≥ A)  
     
   <!-- sqra:qg_revision=b2aff09f4b1b57132550a9d16780e33771e2923ee051600044c3348c6a659217 -->
   <!-- sqra-placement-anchor -->
   [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_iotdb&pullRequest=18452)
   
   ##   
   ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/light_bulb-16px.png '') Catch issues before they fail your Quality Gate with our IDE extension ![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/sonarlint-16px.png '') [SonarQube for IDE](https://www.sonarsource.com/products/sonarlint/features/connected-mode/?referrer=pull-request)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix: reuse pre-computed ArrayList instance size in AlignedTVList ram cost [iotdb]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #18452:
URL: https://github.com/apache/iotdb/pull/18452#issuecomment-5263380643

   ## [Codecov](https://app.codecov.io/gh/apache/iotdb/pull/18452?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 43.74%. Comparing base ([`ef0a792`](https://app.codecov.io/gh/apache/iotdb/commit/ef0a792a3aafe8ff4b3261c973881b39e890ddcf?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`4756ece`](https://app.codecov.io/gh/apache/iotdb/commit/4756eceecbb8fb465e211984aaff8115c1f437f5?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 2 commits behind head on master.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #18452      +/-   ##
   ============================================
   + Coverage     43.54%   43.74%   +0.20%     
     Complexity      374      374              
   ============================================
     Files          5401     5401              
     Lines        386961   387085     +124     
     Branches      50456    50482      +26     
   ============================================
   + Hits         168484   169349     +865     
   + Misses       218477   217736     -741     
   ```
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/iotdb/pull/18452?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org