Skip to content

Commit f343236

Browse files
rustyconoverclaude
andcommitted
perf(build): drop arrow/api.h umbrella from vgi_logging.hpp
vgi_logging.hpp is included by ~34 TUs (it hosts the VGI_LOG macros), and each was parsing the full <arrow/api.h> umbrella (~92k preprocessed lines) solely because HandleBatchLogMessage declares shared_ptr<arrow::RecordBatch> / shared_ptr<arrow::KeyValueMetadata> parameters. Those are forward-declarable since the header never touches Arrow definitions. Replace the include with forward declarations and move <arrow/api.h> into vgi_logging.cpp where the definitions are actually used. Cuts the Arrow header parse out of every logging-only TU. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 0e5eb64 commit f343236

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/include/vgi_logging.hpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@
66

77
#include "vgi_platform.hpp" // pid_t (real on POSIX, shim on Windows)
88

9-
#include <arrow/api.h>
9+
// Arrow types appear only as shared_ptr parameters below, so forward
10+
// declarations suffice here. Pulling in the full <arrow/api.h> umbrella from
11+
// this header is expensive because vgi_logging.hpp is included by ~34 TUs; the
12+
// definitions are only needed in vgi_logging.cpp.
13+
namespace arrow {
14+
class RecordBatch;
15+
class KeyValueMetadata;
16+
} // namespace arrow
1017

1118
#include "duckdb/logging/logging.hpp"
1219
#include "duckdb/logging/log_type.hpp"

src/vgi_logging.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include "vgi_ifunction_connection.hpp"
66
#include "yyjson.hpp"
77

8+
#include <arrow/api.h> // full Arrow definitions for HandleBatchLogMessage (forward-declared in the header)
9+
810
#include <algorithm>
911
#include <atomic>
1012
#include <chrono>

0 commit comments

Comments
 (0)