Skip to content

Commit

Permalink
treewide: include core/format.hh when appropriate
Browse files Browse the repository at this point in the history
before this change, we include core/print.hh for formatting and/or
for printing. but core/print.hh includes `<iostream>` which is a
heavyweight header in the C++ standard library. under most
circumstances, all we need is but `seastar::format()`, which is
provided by a smaller header -- `core/format.hh`.

in this change, we include `core/format.hh` instead of `core/print.hh`
when appropriate. and adapt the translation units where `iostream` is
used to include this header.

this should reduce the header dependency of Seastar library and
speed up the compilation.

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Nov 4, 2024
1 parent 812c945 commit d145145
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/io_tester/ioinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
/*
* Copyright (C) 2021 ScyllaDB
*/
#include <iostream>
#include <seastar/core/app-template.hh>
#include <seastar/core/thread.hh>
#include <seastar/core/reactor.hh>
Expand Down
1 change: 1 addition & 0 deletions apps/rpc_tester/rpc_tester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* Copyright (C) 2022 ScyllaDB
*/

#include <iostream>
#include <vector>
#include <chrono>
#include <random>
Expand Down
1 change: 1 addition & 0 deletions demos/rpc_demo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* Copyright 2015 Cloudius Systems
*/
#include <cmath>
#include <iostream>
#include <ranges>
#include <seastar/core/reactor.hh>
#include <seastar/core/app-template.hh>
Expand Down
2 changes: 1 addition & 1 deletion include/seastar/core/internal/estimated_histogram.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include <algorithm>
#include <vector>
#include <chrono>
#include <string>
#include <seastar/core/metrics_types.hh>
#include <seastar/core/print.hh>
#include <seastar/core/bitops.hh>
#include <limits>
#include <array>
Expand Down
2 changes: 1 addition & 1 deletion include/seastar/rpc/rpc_impl.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
*/
#pragma once

#include <seastar/core/format.hh>
#include <seastar/core/function_traits.hh>
#include <seastar/core/shared_ptr.hh>
#include <seastar/core/sstring.hh>
#include <seastar/core/when_all.hh>
#include <seastar/util/is_smart_ptr.hh>
#include <seastar/core/simple-stream.hh>
#include <seastar/net/packet-data-source.hh>
#include <seastar/core/print.hh>

#include <boost/type.hpp> // for compatibility

Expand Down
2 changes: 1 addition & 1 deletion include/seastar/util/backtrace.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#pragma once

#include <seastar/core/format.hh>
#include <seastar/core/sstring.hh>
#include <seastar/core/print.hh>
#include <seastar/core/scheduling.hh>
#include <seastar/core/shared_ptr.hh>
#include <seastar/util/modules.hh>
Expand Down
2 changes: 1 addition & 1 deletion include/seastar/util/program-options.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#pragma once

#include <seastar/core/format.hh>
#include <seastar/core/sstring.hh>
#include <seastar/core/print.hh>
#include <seastar/util/modules.hh>

#ifndef SEASTAR_MODULE
Expand Down
1 change: 1 addition & 0 deletions src/net/dpdk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module;

#include <cinttypes>
#include <atomic>
#include <iostream>
#include <vector>
#include <queue>
#include <getopt.h>
Expand Down

0 comments on commit d145145

Please sign in to comment.