You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: Debounce information schema queries to Cube Store (1.8x) (#9879)
Introduces the @AsyncDebounce decorator to debounce promises for the getTablesQuery and getPrefixTablesQuery methods. This prevents redundant concurrent executions of the same operations, improving performance by avoiding duplicate database metadata queries.
For the performance benchmark, I've used 1 cube with 1 pre-agg that has 10 partitions, partitioned by time dimension with year granularity.
Previously, Cube would run 10 queries for the information schema while loading pre-aggregation.
### (average across runs)
• Throughput almost doubled – from ~112 req/s (max 144) to ~206 req/s (max 229).
• Average latency halved – from ~0.98 s to ~0.54 s.
• p95 latency dropped from ~2.19 s to ~0.91 s.
• Fast responses (<1 s) surged from ~57% to ~95%, with some runs hitting 100%.
• Success rate improved from ~86% to ~98%, reaching 100% in the best runs.
• Max latency fell from peaks of ~4.06 s to just ~2.05 s.
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+
## Package Overview
6
+
7
+
The `@cubejs-backend/shared` package contains shared utilities, types, and helper functions used across all Cube backend packages. This package provides core functionality like environment configuration, promise utilities, decorators, and common data types.
8
+
9
+
## Development Commands
10
+
11
+
**Note: This project uses Yarn as the package manager.**
12
+
13
+
```bash
14
+
# Build the package
15
+
yarn build
16
+
17
+
# Build with TypeScript compilation
18
+
yarn tsc
19
+
20
+
# Watch mode for development
21
+
yarn watch
22
+
23
+
# Run unit tests
24
+
yarn unit
25
+
26
+
# Run linting
27
+
yarn lint
28
+
29
+
# Fix linting issues
30
+
yarn lint:fix
31
+
```
32
+
33
+
## Architecture Overview
34
+
35
+
### Core Components
36
+
37
+
The shared package is organized into several key modules:
38
+
39
+
1.**Environment Configuration** (`src/env.ts`): Centralized environment variable management with type safety and validation
40
+
2.**Promise Utilities** (`src/promises.ts`): Async helpers including debouncing, memoization, cancellation, and retry logic
41
+
3.**Decorators** (`src/decorators.ts`): Method decorators for cross-cutting concerns like async debouncing
42
+
4.**Type Helpers** (`src/type-helpers.ts`): Common TypeScript utility types used across packages
43
+
5.**Time Utilities** (`src/time.ts`): Date/time manipulation and formatting functions
44
+
6.**Process Utilities** (`src/process.ts`): Process management and platform detection
0 commit comments