Skip to content

Commit

Permalink
Small improvement to compilation time
Browse files Browse the repository at this point in the history
Compile the event list into its own object file and forward-declare
  • Loading branch information
windytan committed Dec 28, 2024
1 parent b949e37 commit fa7b55f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: build

on:
push:
branches: [ master ]
branches: [ master, dev-dont-use ]
tags: [ 'v*' ]
pull_request:
branches: [ master ]
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* Build system fixes:
* macOS: ask Homebrew about liquid-dsp location instead of hardcoding it
* Set default installation prefix to /usr/local (all platforms)
* Reduce compiler workload somewhat with forward declarations

## 1.0.1 (2024-07-19)

Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ line instead of `meson compile` to limit the number of build processes:

$ taskset -c 0 meson compile

The compilation will still require at least 500 MB of free RAM.

## Usage

Redsea reads an MPX signal from stdin by default. It expects the input
Expand Down Expand Up @@ -217,6 +219,7 @@ redsea -f WAVEFILE
* Linux/macOS/Cygwin/MSYS2+MinGW
* C++14 compiler
* meson + ninja
* 500 MB of free memory for non-parallel build ([breakdown](https://github.com/windytan/redsea/issues/120#issuecomment-2559254338))

### Testing

Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ sources_no_main = [
'src/rdsstring.cc',
'src/tables.cc',
'src/tmc/csv.cc',
'src/tmc/events_data.cc',
'src/tmc/tmc.cc',
'src/tmc/locationdb.cc',
'src/util.cc',
Expand Down
16 changes: 16 additions & 0 deletions src/tmc/events.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef TMC_EVENTS_H_
#define TMC_EVENTS_H_

#include <array>
#include <string>

namespace redsea {
namespace tmc {

extern const std::array<std::string, 1553> tmc_data_events;
extern const std::array<std::string, 233> tmc_data_suppl;

} // namespace tmc
} // namespace redsea

#endif // TMC_EVENTS_H_
4 changes: 1 addition & 3 deletions src/tmc/event_list.h → src/tmc/events_data.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#ifndef TMC_EVENT_LIST_H_
#define TMC_EVENT_LIST_H_
#include "events.h"

#include <array>
#include <string>
Expand Down Expand Up @@ -1801,4 +1800,3 @@ const std::array<std::string, 233> tmc_data_suppl{

} // namespace tmc
} // namespace redsea
#endif // TMC_EVENT_LIST_H_
2 changes: 1 addition & 1 deletion src/tmc/tmc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "src/common.h"
#include "src/tables.h"
#include "src/tmc/csv.h"
#include "src/tmc/event_list.h"
#include "src/tmc/events.h"
#include "src/tmc/locationdb.h"

namespace redsea {
Expand Down

0 comments on commit fa7b55f

Please sign in to comment.