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

Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

Enable skipCloneValue on Leoric

Based on Leoric PR #446 (feat: options.skipCloneValue), this feature improves performance by skipping the cloning of database values for change tracking.

Changes Made:

  • Added skipCloneValue: true to the ORM configuration in config/config.default.ts with explanatory comments (including PR reference and bilingual explanation)

Why This Change:

This optimization reduces memory overhead by avoiding unnecessary cloning of database values. By default, Leoric clones values to track model changes, but with skipCloneValue: true, the same object reference is used, improving performance in high-throughput scenarios.

The configuration includes comments explaining:

  • Link to the Leoric PR #446 for reference
  • English explanation: "Skip cloning database values for performance optimization"
  • Chinese explanation: "跳过克隆数据库值以优化性能,减少内存分配"

Security Summary:

  • No security vulnerabilities detected by CodeQL
  • No new linting errors introduced
  • TypeScript compilation succeeds

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 10, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Enable skipCloneValue on leoric feat: enable skipCloneValue on leoric Dec 10, 2025
Copilot AI requested a review from fengmk2 December 10, 2025 11:44
...database,
database: database.name ?? 'cnpmcore',
charset: 'utf8mb4',
skipCloneValue: true,
Copy link
Member

Choose a reason for hiding this comment

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

@copilot 添加注释备忘,让后续的维护者知道为什么会开启这个配置

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已添加注释说明,包含 PR 链接和中英文说明。详见 commit 4780cd1


config.orm = {
database: database.name ?? 'cnpmcore_unittest',
skipCloneValue: true,
Copy link
Member

Choose a reason for hiding this comment

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

@copilot 这里不需要添加

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已在 commit f5e310d 中移除

@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.26%. Comparing base (7ea05ce) to head (33c35c0).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #924      +/-   ##
==========================================
- Coverage   95.37%   95.26%   -0.12%     
==========================================
  Files         197      197              
  Lines       22136    22139       +3     
  Branches     2442     2429      -13     
==========================================
- Hits        21113    21091      -22     
- Misses       1023     1048      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Removed skipCloneValue from ORM configuration.

Signed-off-by: MK (fengmk2) <[email protected]>
Removed commented Chinese text for clarity.

Signed-off-by: MK (fengmk2) <[email protected]>
@fengmk2 fengmk2 changed the title feat: enable skipCloneValue on leoric feat: enable skipCloneValue on leoric for performance optimization Dec 10, 2025
@fengmk2 fengmk2 changed the title feat: enable skipCloneValue on leoric for performance optimization feat: enable skipCloneValue on leoric Dec 10, 2025
@fengmk2 fengmk2 marked this pull request as ready for review December 10, 2025 11:53
Copilot AI requested a review from fengmk2 December 10, 2025 11:55
@fengmk2 fengmk2 merged commit c04bcbd into master Dec 10, 2025
28 of 29 checks passed
@fengmk2 fengmk2 deleted the copilot/enable-skip-clone-value branch December 10, 2025 11:58
fengmk2 pushed a commit that referenced this pull request Dec 10, 2025
[skip ci]

## 4.15.0 (2025-12-10)

* feat: enable skipCloneValue on leoric (#924) ([c04bcbd](c04bcbd)), closes [#924](#924) [hi#throughput](https://github.com/hi/issues/throughput)
* feat(deps): restore official tar package (#922) ([7ea05ce](7ea05ce)), closes [#922](#922) [#921](#921)
@github-actions
Copy link

🎉 This PR is included in version 4.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants