Reduce response time from 5-20 seconds to under 1 second
Rule:
Implementation:
javascript
// Quick reply
await message.send("Received, processing...");
// Background execution
const result = await processInBackground(task);
// Push result
await message.send(result);
Rule:
Implementation:
javascript
// Before (sequential)
const result1 = await toolA();
const result2 = await toolB();
const result3 = await toolC();
// After (parallel)
const [result1, result2, result3] = await Promise.all([
toolA(),
toolB(),
toolC()
]);
Rule:
Implementation:
javascript
// Cache structure
const cache = {
lastUpdate: timestamp,
userProfile: {...},
memorySummary: {...},
skills: [...]
};
// Check if refresh needed
if (now - lastMessage > 60000 || now - cache.lastUpdate > 60000) {
await refreshCache();
}
ScenarioTrigger MethodAuto-triggerExecute on every message processingScheduled refreshCron job every 1 minuteManual triggerUser inputs "refresh cache"
text
SESSION-STATE.md # Active state + cache
├── cache/ # Cache directory
│ ├── user_profile.json # User profile cache
│ ├── memory_summary.json # Memory summary cache
│ └── skills_list.json # Skills list cache
└── last_refresh.txt # Last refresh timestamp
MetricBeforeAfterFirst Response5-20s<1sTool CallsSequential accumulationParallel executionFile ReadingRead every timeCache hitCache RefreshNoneEvery 1 min / >1 min
bash
# Initialize optimizer
node skills/fast-response-optimizer/bootstrap.js
# Manual cache refresh
node skills/fast-response-optimizer/scripts/cache-manager.js refresh
# Check cache status
node skills/fast-response-optimizer/scripts/cache-manager.js status
# Update message timestamp
node skills/fast-response-optimizer/scripts/cache-manager.js message
Make every response lightning fast ⚡