Skip to content

Conversation

@KSDaemon
Copy link
Member

@KSDaemon KSDaemon commented Apr 4, 2025

This introduces an LRU cache for storing compiled versions of JS data model transpiled files. It improves compilation performance.

Check List

  • Tests have been run in packages where changes made if available
  • Linter has been run for changed code
  • Tests for the changes have been added if not covered yet
  • Docs have been added / updated if required

@KSDaemon KSDaemon marked this pull request as ready for review April 4, 2025 10:39
@KSDaemon KSDaemon requested review from a team as code owners April 4, 2025 10:39
@KSDaemon KSDaemon force-pushed the feat/script-cache branch from de6e653 to d1ff8c8 Compare April 7, 2025 17:41
@KSDaemon KSDaemon requested a review from ovr April 7, 2025 17:42
@codecov
Copy link

codecov bot commented Apr 7, 2025

Codecov Report

Attention: Patch coverage is 87.87879% with 4 lines in your changes missing coverage. Please review.

Project coverage is 47.91%. Comparing base (0a50a8e) to head (efd95f9).
Report is 12 commits behind head on master.

Files with missing lines Patch % Lines
packages/cubejs-server-core/src/core/server.ts 66.66% 2 Missing ⚠️
...y-orchestrator/src/orchestrator/PreAggregations.ts 50.00% 1 Missing ⚠️
...ackages/cubejs-server-core/src/core/CompilerApi.js 88.88% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (0a50a8e) and HEAD (efd95f9). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (0a50a8e) HEAD (efd95f9)
cubesql 2 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #9424       +/-   ##
===========================================
- Coverage   83.75%   47.91%   -35.84%     
===========================================
  Files         229      171       -58     
  Lines       82747    21338    -61409     
  Branches        0     3691     +3691     
===========================================
- Hits        69305    10225    -59080     
+ Misses      13442    10678     -2764     
- Partials        0      435      +435     
Flag Coverage Δ
cube-backend 47.91% <87.87%> (?)
cubesql ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

Copy link
Member

@ovr ovr left a comment

Choose a reason for hiding this comment

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

LGTM, don't forget to release on shutdown.

@KSDaemon KSDaemon force-pushed the feat/script-cache branch from ae25475 to efd95f9 Compare April 8, 2025 12:51
@KSDaemon KSDaemon merged commit e923a0f into master Apr 8, 2025
59 checks passed
@KSDaemon KSDaemon deleted the feat/script-cache branch April 8, 2025 14:15
marianore-muttdata pushed a commit to MuttData/cube that referenced this pull request Jun 17, 2025
…ripts (cube-js#9424)

* fix types

* update lru-cache to the latest

* fix lru-cache after upgrade

* introduce compiledScriptCache

* add proactive cache cleanup

* call compilerCache.clear() on shutdown
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.

3 participants