Commit Graph

57 Commits

Author SHA1 Message Date
Daniel Patterson
468d8c0031 Refactor logging, improve error handling workflow, clang-format. (#3385) 2016-12-06 12:30:46 -08:00
Michael Krasnyk
e343f71541 Refactor Hilbert values computation 2016-11-28 14:17:12 +01:00
Daniel Patterson
53ef2e2955 Use an enum type for the 'should read fingerprint' flag, rather than a mysterious boolean
Fix tests.
2016-11-15 16:55:02 -08:00
Daniel Patterson
2f9b5788d0 Destructor should fail hard if an exception is raised. 2016-11-15 16:55:02 -08:00
Daniel Patterson
4ad6d88888 Refactor file loading to use a common class that has proper error handling. 2016-11-15 16:55:02 -08:00
Daniel Patterson
e226b52f21 const-ify things, use RAII for file closure, and start to use io:: to read some stuff. 2016-11-15 16:55:02 -08:00
Huyen Chau Nguyen
cf35bbeb50 refactor function names; consolidate readCount() functions;
remove templated types as much as possible for type safety;
add more comments;
clean up code, add const if possible;
2016-10-26 13:18:52 -07:00
Huyen Chau Nguyen
fe94977c9b refactor loading code of .ramIndex files and move to io.hpp 2016-10-26 13:18:52 -07:00
Daniel J. Hofmann
e3a38a6b0d Fixes compilation against newer Boost versions; seems like we were lucky before; closes #2889 2016-09-09 16:14:25 +02:00
Patrick Niklaus
c7a1576100
Apply clang-format again 2016-07-26 15:00:58 +02:00
Daniel Patterson
0b868969be
Remove generic std::exception handlers, they don't seem to be adding value, and they hide useful info. 2016-07-26 11:43:08 +02:00
Daniel Patterson
ec02cdc4cc Use mmap instead of read - it's a lot faster here.
Also clean up construction of STRONG_TYPEDEF so that it can be
packed properly in structs (this explains all the () -> {}) changes
here.
2016-06-27 17:24:30 -07:00
Michael Krasnyk
25d3c4b843
Updated change log and adjusted format 2016-05-29 07:39:49 +02:00
Michael Krasnyk
371c06d66d
Change size of QueryCandidate from 32 to 24 bytes 2016-05-29 07:39:49 +02:00
Michael Krasnyk
3e5c978719
Reduce ramIndex file size
PR #2472: the bottom-most node of the r-tree contains
only a single index to a leaf node, so out of 532 bytes
only 4 are used.
2016-05-29 07:39:49 +02:00
Michael Krasnyk
843f1a6356
Set LeafNode alignment to LEAF_PAGE_SIZE bytes
References:
- https://github.com/Project-OSRM/osrm-backend/pull/2348#issuecomment-219804408
- http://stackoverflow.com/questions/15523537/alignas-specifier-vs-attribute-aligned-c11
- http://stackoverflow.com/questions/7895869/cross-platform-alignx-macro
2016-05-29 07:39:49 +02:00
Patrick Niklaus
6e16eab6ec
Format with clang-format 3.8 2016-05-27 21:05:04 +02:00
Michael Krasnyk
7e80dae59b
Fix MSVS build. 2016-05-08 06:00:21 +02:00
Patrick Niklaus
7564633045
Update SearchInBox to not copy TreeNode 2016-05-07 23:52:11 +02:00
Patrick Niklaus
7174c5d036
Make StaticRTree and facades const 2016-05-07 23:52:11 +02:00
Patrick Niklaus
ddd128ce0e
Only use const-ref for coordinate vector 2016-05-07 23:52:11 +02:00
Michael Krasnyk
2acde49f0f
Make LeafNode aligned to memory pages.
Changes:
* LeafNode is aligned to LEAF_PAGE_SIZE.
  Alignment brings 24 bytes memory overhead for 4096, but reduces
  cache misses rate.
* Unused m_element_count from leaf nodes file.
  The size is computed as m_leaves_region.size() / LEAF_PAGE_SIZE.
* Added try/catch for mmap exceptions messages.
2016-05-07 23:52:11 +02:00
Michael Krasnyk
8849015bbf
Fix construct_multiple_levels_test
candidate_cache is removed because of failing test
make util-tests && ./unit_tests/util-tests --run_test=*/construct_multiple_levels_test
first bad commit: [9692be6f50] Add cache for CandidateSegments to reduce heap worke even more

Now SegmentIndex contains leaf index, object index and fixed_projected_coordinate
2016-05-07 23:52:11 +02:00
Michael Krasnyk
70cd7a94ec
Fix memory mapping "Invalid argument" exception. 2016-05-07 23:52:11 +02:00
Patrick Niklaus
3984dea34b
Use mmap in StaticRTree 2016-05-07 23:52:11 +02:00
Patrick Niklaus
b11b471aa4
Move LoadLeafFromDisk to return by value 2016-05-07 23:52:11 +02:00
Patrick Niklaus
63754df4d4
Add cache for CandidateSegments to reduce heap worke even more 2016-05-07 23:52:11 +02:00
Patrick Niklaus
e644424508
Only save TreeNode index in search tree x3 speedup 2016-05-07 23:52:11 +02:00
Moritz Kobitzsch
ae45ad1ad2 fix r-tree abort location 2016-04-14 11:40:36 +02:00
Patrick Niklaus
5052c4ae3a Move projection function into own header and inline 2016-04-09 17:31:36 +02:00
Patrick Niklaus
67834def5f Switch to uint64 for distance measurements in StaticRTree 2016-04-09 17:26:27 +02:00
Patrick Niklaus
c51ffeb65a Switch StaticRTree leaf size to 256 elements per leaf
This increses query performance dramatically for queries with a lot of
coordinates. However it increases the internal memory usage of the
StaticRTree also 4x.
2016-04-09 17:26:27 +02:00
Moritz Kobitzsch
dfd180a292 fixing unit tests 2016-04-08 11:21:14 +02:00
Patrick Niklaus
6e50b5fc60 Filter segments correctly by bounding box 2016-04-05 22:59:14 +02:00
Patrick Niklaus
30a9bc3179 Fix mathematical assumptions in StaticRTree
StaticRTree now uses projected coordinates internally. That means we can
use a euclidean distance measure (squared distance) for sorting the
query queue.
2016-04-05 22:59:14 +02:00
Patrick Niklaus
fda4656630 Implement re-enabling of PhantomNode directions after bearing filtering 2016-04-05 22:59:14 +02:00
Patrick Niklaus
5829bbe22d Move Centroid to coordinate_calculation 2016-04-05 22:59:14 +02:00
Patrick Niklaus
d9d4742130 First round of lat,lng -> lng,lat switcheroo 2016-04-05 22:58:32 +02:00
Daniel J. Hofmann
ac0279aa83 RAII for auto-closing file streams
Small fixes I didn't want to include in unrelated PRs.

There are a few left in `storage.cpp` but since it's a single function
in 600 lines of code, I didn't want to touch the mess. The others are
safe to remove, cucumber and test run on Finland gives 👍.
2016-03-09 17:46:02 +01:00
Daniel Patterson
49441fe204 Make forward/reverse weight/offset calculated at query time,
rather than being cached in the StaticRTree.  This means we
can freely apply traffic data and not have stale values lying
around.  It reduces the size of the RTree on disk, at the expense
of some additional data in RAM.
2016-03-03 10:49:12 -08:00
Daniel J. Hofmann
66cadac6b6 Explicitly std:: prefix fixed integral types in static rtree header 2016-03-01 23:51:26 +01:00
Daniel J. Hofmann
aeee565115 Formats all the files we touch.. 2016-03-01 23:51:25 +01:00
Daniel Patterson
5dc7b79bb6 Implements a vector tileserver so you can see what's going on inside
OSRM.
2016-03-01 23:51:25 +01:00
Daniel J. Hofmann
47d56676f1 Don't bounds check by default in static rtree; fixes #1988 2016-02-17 18:20:27 -08:00
Daniel J. Hofmann
64b36807d3 Transforms osrm_exception to exception 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
5de8f1803c Folds mercator projections into coordinate_calculation 2016-02-12 15:46:24 -08:00
Daniel J. Hofmann
a48f02e0da Takes care of proper special member generation globally, fixes #1689
Phew, a lot of classes were affected by this. The rationale for the
changes are as follows:

- When a type X declares any constructor, the default constructor is
  not declared, so there is no need for X() = delete there. In fact,
  there is brutal difference between those two: deleted members
  participate in overload resolution, but not-declared members do not!

- When a type X wants to be non-copyable (e.g. to be only movable, like
  threads, unique_ptrs, and so on), you can either do it by inheriting
  from boost::noncopyable (the old way), or better declare both (!) the
  copy constructor _and_ the copy assignment operator as deleted:

      X(X const&) = delete;
      X& operator=(X const&) = delete;

  We had tons of types with deleted copy constructors that were lacking
  a corresponding deleted copy assignment operator, making them still
  copyable and you wouldn't even notice (read: scary)!

References:

- http://accu.org/content/conf2014/Howard_Hinnant_Accu_2014.pdf
- http://www.boost.org/doc/libs/master/libs/core/doc/html/core/noncopyable.html

Note: I know, I'm quoting Hinnant's extraordinary slides a lot, but
getting the sematic right here is so incredibly important.
2016-01-27 17:25:30 +01:00
Daniel J. Hofmann
38e8a90f4e Make HilbertCode a free standing function 2016-01-26 22:57:02 +01:00
Daniel J. Hofmann
d391df52ba Be kind to the optimizer, pass coordinates by value (just two ints) 2016-01-26 22:57:02 +01:00
Patrick Niklaus
439eb9da3d Create public facing libraries for extractor, contractor and datastore
New libraries libosrm_extract, libosrm_contract, libosrm_store
2016-01-21 06:47:34 +01:00