bytechefhq / bytechefhq/bytechef

[task] Optimize IntelliJ startup time with component filtering and pre-built JARs

Open
#4,481 0 comments 0 reactions 1 assignee Claimed by @ivicac View on GitHub
backend task
Dominant language
Java
Stars
1k
Forks
170
Avg merge
11h 25m
Merged PRs (30d)
115

Description

## Summary

IntelliJ startup takes ~60+ seconds compared to ~10 seconds with `./gradlew bootRun`. This is caused by:

- **Classpath scanning**: `@SpringBootApplication(scanBasePackages = "com.bytechef")` scans 4354 Java files (~20-30s)
- **ServiceLoader discovery**: 174 component modules discovered via `ServiceLoader.load()` (~15-20s)
- **Exploded class directories**: IntelliJ uses class dirs vs Gradle's optimized JARs (~10-15s)
- **Auto-configuration**: RabbitMQ, Kafka, AI, AWS auto-configs initialize (~5-10s)

## Changes

### 1. Component Filtering (Whitelist/Blacklist)
Control which component modules are included in the classpath via `gradle.properties`:
- `includeComponents=http-client,script,var,data-mapper,logger` (whitelist - fastest)
- `excludeComponents=salesforce,hubspot,shopify` (blacklist)

### 2. Pre-built Component JARs
Use pre-built JAR files instead of project dependencies (`useComponentJars=true`). ServiceLoader reads from JAR manifests (instant) instead of scanning directories (slow).

### 3. IntelliJ Spring Profile (`application-intellij.yml`)
- Reduced logging noise
- Disabled GraphQL playground
- Disabled Liquibase in dev

### 4. Startup Timing Analysis
`StartupTimingConfiguration` logs warnings for any bean taking >100ms to initialize (enabled via `startup-timing` profile).

### 5. Pre-configured IntelliJ Run Configurations
`.run/` directory with ready-to-use configurations:
- `ServerApplication (Fast Dev)` - Lazy init + optimized JVM
- `ServerApplication (Pre-built JARs)` - Uses JAR dependencies
- `ServerApplication (Gradle Delegated)` - Delegates to Gradle bootRun
- `1. Build Component JARs` - Builds component JARs

### 6. Optimized JVM Options
`-Xms512m -Xmx2g -XX:+UseG1GC -XX:TieredStopAtLevel=1` for 50% less memory and faster startup.

## Expected Results

| Configuration | Components | Startup Time | Memory |
|---|---|---|---|
| Default IntelliJ | 174 | ~60s | ~4GB |
| + intellij profile | 174 | ~40s | ~2GB |
| + Component filtering (5) | 5 | ~15-20s | ~1.5GB |
| + Pre-built JARs | 5 | **~10s** | **~1.5GB** |

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.