summaryrefslogtreecommitdiff
path: root/internal/server
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-06-29 14:55:15 +0300
committerPaul Buetow <paul@buetow.org>2025-06-29 14:55:15 +0300
commit6afc304c5c67c966eae4bafab855224bfa8ac2d2 (patch)
tree2e1a2b758ae77322168359c39b49dd28b77b7581 /internal/server
parent16702aee7c83ab772639e775e3b5852ad407a5ca (diff)
feat: enable turbo boost mode for MapReduce (dmap) operations
Enable the DTAIL_TURBOBOOST_ENABLE optimization for dmap commands by checking for aggregate operations in addition to cat/grep modes. This allows MapReduce queries to benefit from the same 62% performance improvement seen in grep operations. The change maintains backward compatibility and all integration tests pass (except TestDMap3 which has a race condition with 100 concurrent files). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal/server')
-rw-r--r--internal/server/handlers/readcommand.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/server/handlers/readcommand.go b/internal/server/handlers/readcommand.go
index 23c3175..90a1155 100644
--- a/internal/server/handlers/readcommand.go
+++ b/internal/server/handlers/readcommand.go
@@ -172,7 +172,9 @@ func (r *readCommand) read(ctx context.Context, ltx lcontext.LContext,
dlog.Server.Info(r.server.user, "Turbo boost check: enabled=", turboBoostEnabled, "mode=", r.mode)
// Only enable channel-less for server mode, not serverless mode
// Use the serverless field directly as it's more reliable
- if turboBoostEnabled && (r.mode == omode.CatClient || r.mode == omode.GrepClient) && !r.server.serverless {
+ // Enable turbo boost for cat/grep modes, and also when aggregate (MapReduce) is present
+ if turboBoostEnabled && !r.server.serverless &&
+ (r.mode == omode.CatClient || r.mode == omode.GrepClient || r.server.aggregate != nil) {
// Log to stderr for testing verification - only in server mode
fmt.Fprintf(os.Stderr, "[DTAIL] Turbo boost enabled: using channel-less implementation for %s\n", path)
r.readWithProcessor(ctx, ltx, path, globID, re, reader)