Skip to content

Commit

Permalink
improve shapes loading performance (#619)
Browse files Browse the repository at this point in the history
* improve shapes loading performance

* wip

* formatting

* wip

* wip

* sort by shape seq

* wip
  • Loading branch information
felixguendling authored Oct 25, 2024
1 parent a9d90a3 commit 80573de
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .pkg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[nigiri]
url=git@github.com:motis-project/nigiri.git
branch=master
commit=2a8ff06c58ab19b2bfd66cca77c1fced7383c160
commit=06fc5ef490a275d3c73226946f34a7292a22373e
[cista]
url=git@github.com:felixguendling/cista.git
branch=master
Expand Down
8 changes: 4 additions & 4 deletions .pkg.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
10524910969379885246
cista 56e9191ad64cbd4176aef32a631562ca92f5bd4a
3138594266080098835
cista fabfc0cbcf07343a2e0c2def3009555b22f0ae46
zlib-ng 68ab3e2d80253ec5dc3c83691d9ff70477b32cd3
boost 73549ebca677fe6214202a1ab580362b4f80e653
googletest 7b64fca6ea0833628d6f86255a81424365f7cc0c
libressl 24acd9e710fbe842e863572da9d738715fbc74b8
fmt dc10f83be70ac2873d5f8d1ce317596f1fd318a2
utl 9a6f1ef3ef8f5e764ce87ec446141c64ee6dcd73
utl 8bfa7fc4edc23f716173bdfbcab8294fcc31e457
net 7b089e022471bb5adf716d0c7b0cdb57a23c7adc
PEGTL 1c1aa6e650e4d26f10fa398f148ec0cdc5f0808d
res b759b93316afeb529b6cb5b2548b24c41e382fb0
Expand All @@ -23,7 +23,7 @@ opentelemetry-cpp 60770dc9dc63e3543fc87d605b2e88fd53d7a414
pugixml 60175e80e2f5e97e027ac78f7e14c5acc009ce50
unordered_dense b33b037377ca966bbdd9cccc3417e46e88f83bfb
wyhash 1e012b57fc2227a9e583a57e2eacb3da99816d99
nigiri 2a8ff06c58ab19b2bfd66cca77c1fced7383c160
nigiri 06fc5ef490a275d3c73226946f34a7292a22373e
conf f9bf4bd83bf55a2170725707e526cbacc45dcc66
expat 636c9861e8e7c119f3626d1e6c260603ab624516
libosmium 6e6d6b3081cc8bdf25dda89730e25c36eb995516
Expand Down
4 changes: 2 additions & 2 deletions src/data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "osr/ways.h"

#include "nigiri/rt/create_rt_timetable.h"
#include "nigiri/shape.h"
#include "nigiri/shapes_storage.h"
#include "nigiri/timetable.h"

#include "motis/config.h"
Expand Down Expand Up @@ -148,7 +148,7 @@ void data::init_rtt(date::sys_days const d) {
void data::load_shapes() {
shapes_ = {};
shapes_ = std::make_unique<nigiri::shapes_storage>(
nigiri::shapes_storage{path_ / "shapes", cista::mmap::protection::READ});
nigiri::shapes_storage{path_, cista::mmap::protection::READ});
}

void data::load_railviz() {
Expand Down
6 changes: 3 additions & 3 deletions src/import.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "nigiri/common/parse_date.h"
#include "nigiri/rt/create_rt_timetable.h"
#include "nigiri/rt/rt_timetable.h"
#include "nigiri/shape.h"
#include "nigiri/shapes_storage.h"
#include "nigiri/timetable.h"

#include "osr/extract/extract.h"
Expand All @@ -60,7 +60,7 @@ namespace motis {

constexpr auto const kAdrBinaryVersion = 1U;
constexpr auto const kOsrBinaryVersion = 3U;
constexpr auto const kNigiriBinaryVersion = 4U;
constexpr auto const kNigiriBinaryVersion = 6U;
constexpr auto const kMatchesBinaryVersion = 4U;

using meta_entry_t = std::pair<std::string, std::uint64_t>;
Expand Down Expand Up @@ -269,7 +269,7 @@ data import(config const& c, fs::path const& data_path, bool const write) {

if (t.with_shapes_) {
d.shapes_ = std::make_unique<n::shapes_storage>(
n::shapes_storage(data_path / "shapes"));
data_path, cista::mmap::protection::WRITE);
}

d.tags_ = cista::wrapped{cista::raw::make_unique<tag_lookup>()};
Expand Down
1 change: 0 additions & 1 deletion src/railviz.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "nigiri/rt/frun.h"
#include "nigiri/rt/rt_timetable.h"
#include "nigiri/rt/run.h"
#include "nigiri/shape.h"
#include "nigiri/timetable.h"
#include "nigiri/types.h"

Expand Down

0 comments on commit 80573de

Please sign in to comment.