Skip to content

Commit

Permalink
Optimize includes (#1781)
Browse files Browse the repository at this point in the history
Remove unused `#include` directives, or move them from header files to the `.cpp` files. This should reduce QLever's compile time by a significant amount, especially as the expensive `CTRE` headers are included in less places.
  • Loading branch information
RobinTF authored Feb 10, 2025
1 parent 463700e commit 551288e
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/engine/ExportQueryExecutionTrees.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "ExportQueryExecutionTrees.h"

#include <absl/strings/str_cat.h>
#include <absl/strings/str_replace.h>

#include <ranges>

Expand Down
3 changes: 3 additions & 0 deletions src/engine/sparqlExpressions/ConvertToNumericExpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
// Chair of Algorithms and Data Structures
// Author: Hannes Baumann <[email protected]>

#include <absl/strings/ascii.h>
#include <absl/strings/charconv.h>

#include "engine/sparqlExpressions/NaryExpressionImpl.h"

namespace sparqlExpression {
Expand Down
3 changes: 0 additions & 3 deletions src/engine/sparqlExpressions/NaryExpressionImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

#include <ranges>

#include "absl/strings/ascii.h"
#include "absl/strings/charconv.h"
#include "engine/sparqlExpressions/NaryExpression.h"
#include "engine/sparqlExpressions/SparqlExpressionGenerators.h"
#include "engine/sparqlExpressions/SparqlExpressionValueGetters.h"
#include "util/CryptographicHashUtils.h"
Expand Down
1 change: 0 additions & 1 deletion src/engine/sparqlExpressions/SparqlExpressionPimpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "engine/VariableToColumnMap.h"
#include "engine/sparqlExpressions/PrefilterExpressionIndex.h"
#include "parser/data/Variable.h"
#include "util/HashMap.h"
#include "util/HashSet.h"

namespace sparqlExpression {
Expand Down
2 changes: 0 additions & 2 deletions src/engine/sparqlExpressions/SparqlExpressionTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include "engine/QueryExecutionContext.h"
#include "engine/sparqlExpressions/SetOfIntervals.h"
#include "global/Id.h"
#include "parser/LiteralOrIri.h"
#include "parser/TripleComponent.h"
#include "parser/data/Variable.h"
#include "util/AllocatorWithLimit.h"
#include "util/HashSet.h"
Expand Down
1 change: 0 additions & 1 deletion src/global/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#pragma once

#include <chrono>
#include <ctre.hpp>
#include <stdexcept>
#include <string>
#include <string_view>
Expand Down
1 change: 1 addition & 0 deletions src/util/ConfigManager/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <ANTLRInputStream.h>
#include <CommonTokenStream.h>
#include <absl/strings/str_cat.h>
#include <absl/strings/str_replace.h>
#include <antlr4-runtime.h>

#include <functional>
Expand Down
3 changes: 1 addition & 2 deletions src/util/GeoSparqlHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
#ifndef QLEVER_GEOSPARQLHELPERS_H
#define QLEVER_GEOSPARQLHELPERS_H

#include <ctre-unicode.hpp>
#include <limits>
#include <optional>
#include <string>
#include <string_view>

#include "parser/GeoPoint.h"

Expand Down
1 change: 1 addition & 0 deletions src/util/StringUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "util/StringUtils.h"

#include <absl/strings/str_cat.h>
#include <absl/strings/str_replace.h>
#include <unicode/bytestream.h>
#include <unicode/casemap.h>

Expand Down
4 changes: 0 additions & 4 deletions src/util/StringUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,11 @@

#pragma once

#include <absl/strings/str_replace.h>
#include <gmock/gmock-spec-builders.h>

#include <string_view>

#include "backports/algorithm.h"
#include "util/Concepts.h"
#include "util/ConstexprSmallString.h"
#include "util/CtreHelpers.h"

using std::string;
using std::string_view;
Expand Down
3 changes: 3 additions & 0 deletions src/util/StringUtilsImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

#pragma once

#include <ctre-unicode.hpp>

#include "util/Algorithm.h"
#include "util/CtreHelpers.h"
#include "util/Exception.h"
#include "util/StringUtils.h"

Expand Down
3 changes: 2 additions & 1 deletion test/HttpTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Author: Hannah Bast ([email protected])

#include <absl/strings/str_cat.h>
#include <gtest/gtest.h>
#include <gmock/gmock.h>

#include <thread>

Expand All @@ -16,6 +16,7 @@

using namespace ad_utility::httpUtils;
using namespace boost::beast::http;
using ::testing::HasSubstr;

namespace {

Expand Down

0 comments on commit 551288e

Please sign in to comment.