46 Commits
Author SHA1 Message Date
AnyOldName3 3512054da7 Merge branch 'ci-tweaks-2022-rebased-2026-plus-msbuild' into 'master'
CI tweaks 2022

See merge request OpenMW/openmw!5085
2026-01-23 00:07:09 +00:00
AnyOldName3 e68d4317c4 Get rid of unique PCHs from targets with three or fewer translation units
Precompiled headers avoid duplicate work.
If you've only got a single TU using a particular PCH, then there's no duplicate work, so it can only add overhead.

We don't need to totally abandon PCHs for these targets, though, as CMake lets us reuse the PCH from components.

If you've only got a few TUs in a target, it's *probably* faster to get components' PCH for free and eat the cost of it not being perfect than it is to make a perfect PCH from scratch.

Note that I don't know if there are drawbacks due to components having a couple of private precompiled headers that wouldn't have otherwise propagated or these targets having different build flags.
I can't test it locally right now as my linker's regained the deadlocking issue it had the other day.
If it turns out there are problems, then for the single-TU targets, simply avoiding using PCHs for them at all will still be an improvement over the status quo.
For the two-or-three TU targets, we'll have to actually measure things.
2026-01-15 17:44:32 +00:00
AnyOldName3 16efa6e5b5 Support long paths on Windows
Apparently we'd never bothered opting in, despite nearly everything in all out apps being entirely compatible and designed with long paths in mind.

GetModuleFileNameW is a bit awkward as it's just about the only Win32 function that returns the minimum of the buffer size and the string size - nearly everything else returns the full size even if it won't fit, so you can pass it a null pointer and a size of zero, and it'll tell you how much space you need to allocate.

I pretty much just copied the mostly-working long-path-friendly call site in the crash catcher to windowspath.cpp, but I also noticed that if the function failed and returned zero, the original implementation would loop forever, so I fixed that.

There was some code that could be ditched from the catch monitor as \\?\ is a prefix you can use to opt into long paths for a single API call instead of using the manifest to set it everywhere.
2026-01-07 15:12:22 +00:00
Alexei Kotov 46e0369fee Merge branch 'fix_benchmark_distribution' into 'master'
Use uniform_real_distribution for agent half extents

See merge request OpenMW/openmw!5005
2025-11-23 15:00:08 +03:00
elsid 0a2234ad3e Fix C4244 in navmeshtilescache benchmark
apps\benchmarks\detournavigator\navmeshtilescache.cpp(97): warning C4244: 'argument': conversion from 'double' to 'size_t', possible loss of data
apps\benchmarks\detournavigator\navmeshtilescache.cpp(97): note: the template instantiation context (the oldest one first) is
apps\benchmarks\detournavigator\navmeshtilescache.cpp(192): note: see reference to function template instantiation 'void `anonymous-namespace'::getFromFilledCache<1048576,100>(benchmark::State &)' being compiled
apps\benchmarks\detournavigator\navmeshtilescache.cpp(179): note: see reference to function template instantiation 'void `anonymous-namespace'::generateKeys<std::back_insert_iterator<std::vector<`anonymous-namespace'::Key,std::allocator<`anonymous-namespace'::Key>>>,std::linear_congruential_engine<unsigned int,48271,0,2147483647>>(_T0,size_t,_T1 &)' being compiled
        with
        [
            _T0=std::back_insert_iterator<std::vector<`anonymous-namespace'::Key,std::allocator<`anonymous-namespace'::Key>>>,
            _T1=std::linear_congruential_engine<unsigned int,48271,0,2147483647>
        ]
apps\benchmarks\detournavigator\navmeshtilescache.cpp(153): note: see reference to function template instantiation '`anonymous-namespace'::Key `anonymous-namespace'::generateKey<_T1>(size_t,_T0 &)' being compiled
        with
        [
            _T1=std::linear_congruential_engine<unsigned int,48271,0,2147483647>,
            _T0=std::linear_congruential_engine<unsigned int,48271,0,2147483647>
        ]
apps\benchmarks\detournavigator\navmeshtilescache.cpp(141): note: see reference to function template instantiation 'DetourNavigator::Mesh `anonymous-namespace'::generateMesh<_T0>(size_t,_T0 &)' being compiled
        with
        [
            _T0=std::linear_congruential_engine<unsigned int,48271,0,2147483647>
        ]
apps\benchmarks\detournavigator\navmeshtilescache.cpp(99): warning C4244: 'argument': conversion from 'double' to 'size_t', possible loss of data
apps\benchmarks\detournavigator\navmeshtilescache.cpp(112): warning C4244: '=': conversion from 'double' to 'float', possible loss of data
apps\benchmarks\detournavigator\navmeshtilescache.cpp(112): note: the template instantiation context (the oldest one first) is
apps\benchmarks\detournavigator\navmeshtilescache.cpp(144): note: see reference to function template instantiation 'DetourNavigator::Heightfield `anonymous-namespace'::generateHeightfield<_T0>(_T0 &)' being compiled
        with
        [
            _T0=std::linear_congruential_engine<unsigned int,48271,0,2147483647>
        ]
2025-11-21 13:57:51 +01:00
elsid d7db0d3d46 Use uniform_real_distribution for agent half extents
They have float type.
2025-11-19 20:17:22 +01:00
elsid 7c45a564a1 Fix clang-analyzer-deadcode.DeadStores 2025-04-05 12:55:17 +02:00
elsid 9b412bc802 Fix benchmark warning: -Wdeprecated-declarations
Example:

apps/benchmarks/settings/access.cpp: In function ‘void {anonymous}::localStatic(benchmark::State&)’:
apps/benchmarks/settings/access.cpp:43:37: warning: ‘typename std::enable_if<(std::is_trivially_copyable<_Tp>::value && (sizeof (Tp) <= sizeof (Tp*)))>::type benchmark::DoNotOptimize(const Tp&) [with Tp = float; typename std::enable_if<(std::is_trivially_copyable<_Tp>::value && (sizeof (Tp) <= sizeof (Tp*)))>::type = void]’ is deprecated: The const-ref version of this method can permit undesired compiler optimizations in benchmarks [-Wdeprecated-declarations]
   43 |             benchmark::DoNotOptimize(v);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~^~~
2024-03-16 01:58:12 +01:00
elsid 5859fd464c Add option to disable precompiled headers
To be able to use ccache.

Also fix compilation errors appeared due to absence of precompiled
headers.
2024-03-08 02:11:51 +01:00
elsid da5ab2b2c9 Fix benchmark warning: -Wdeprecated-declarations
/home/elsid/dev/openmw/apps/benchmarks/detournavigator/navmeshtilescache.cpp: In function ‘void {anonymous}::getFromFilledCache(benchmark::State&)’:
/home/elsid/dev/openmw/apps/benchmarks/detournavigator/navmeshtilescache.cpp:186:37: warning: ‘typename std::enable_if<((! std::is_trivially_copyable<_Tp>::value) || (sizeof (Tp) > sizeof (Tp*)))>::type benchmark::DoNotOptimize(const Tp&) [with Tp = DetourNavigator::NavMeshTilesCache::Value; typename std::enable_if<((! std::is_trivially_copyable<_Tp>::value) || (sizeof (Tp) > sizeof (Tp*)))>::type = void]’ is deprecated: The const-ref version of this method can permit undesired compiler optimizations in benchmarks [-Wdeprecated-declarations]
  186 |             benchmark::DoNotOptimize(result);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from /home/elsid/dev/openmw/apps/benchmarks/detournavigator/navmeshtilescache.cpp:1:
/home/elsid/dev/benchmark/build/gcc/release/install/include/benchmark/benchmark.h:507:5: note: declared here
  507 |     DoNotOptimize(Tp const& value) {
      |     ^~~~~~~~~~~~~
2024-02-18 14:25:03 +01:00
elsid b17afc4641 Use concepts for some argument types 2023-11-16 22:22:46 +01:00
AnyOldName3 34fcfb63cf Eliminate redundant version checks 2023-07-20 00:43:56 +01:00
elsid 258ae9d98e Add settings index to provide lookup by category and name 2023-05-03 22:11:44 +02:00
elsid 35f4bcd31e Run openmw_settings_access_benchmark in CI
Add benchmarks to access 2 and 3 settings. Use settings with max memory address
distance assuming Settings::Values is single memory location object.

Use settings-default.cfg from the source code repository to initialize settings.
2023-04-24 22:30:49 +02:00
psi29a ad25e9b154 Merge branch 'settings_storage' into 'master'
Typed settings storage (#6876)

See merge request OpenMW/openmw!2651
2023-04-10 10:36:15 +00:00
elsid 740f409a09 Add benchmarks for ESM3ExteriorCellRefId serialization 2023-04-08 01:07:13 +02:00
elsid e5d5c51673 Add benchmarks for settings access 2023-03-28 20:47:34 +02:00
elsid b7fdca0fe6 Use serialized ESM::RefId for Lua records 2023-03-25 18:19:46 +01:00
elsid 30fd8c9d23 Add benchmarks for RefId serialization and deserialization 2023-03-25 14:04:44 +01:00
elsid a762624581 Reorganize and update benchmarks 2023-03-25 00:00:39 +01:00
elsid 1cc4909144 Add --coverage to components_qt, benchmarks and openmw-cs 2023-03-10 21:36:12 +01:00
clang-format-botandζeh Matt ddb0522bbf Apply clang-format to code base 2022-09-22 21:35:26 +03:00
elsid 204ab6fea3 Use version instead of generation and revision for recast mesh 2022-09-06 21:51:48 +02:00
elsid c15848932b Separate reading navigator stats and reporting 2022-08-28 14:52:34 +02:00
elsid 520738277a Support google benchmark v1.6.1 2022-07-06 15:06:59 +02:00
elsid bef15edf0b Remove redundant ostream, istream, iostream and sstream includes
* Replace by std::to_string and operator+ where possible.
* Move the code requiring to include <sstream> from .hpp to .cpp files.
2022-07-05 01:41:28 +02:00
elsidandjvoisin 7e6c13630a Use target_precompile_headers for the most expensive headers 2022-07-01 14:05:17 +00:00
elsid 1a12c453d6 Support different agent collision shape type for pathfinding
Actors may have different collision shapes. Currently there are axis-aligned
bounding boxes and rotating bounding boxes. With AABB it's required to use
bounding cylinder for navmesh agent to avoid providing paths where actor can't
pass. But for rotating bounding boxes cylinder with diameter equal to the front
face width should be used to not reduce of available paths. For example rats
have rotating bounding box as collision shape because of the difference between
front and side faces width.

* Add agent bounds to navmesh tile db cache key. This is required to distinguish
  tiles for agents with different bounds.
* Increase navmesh version because navmesh tile db cache key and data has changed.
* Move navmesh version to the code to avoid misconfiguration by users.
* Fix all places where wrong half extents were used for pathfinding.
2022-06-21 12:57:32 +02:00
elsid 70623d0b23 Move FetchContent for benchmark to extern 2022-01-30 00:44:22 +01:00
Bret CurtisandBret Curtis d1fb854521 move most of the files from esm to esm3, keep common code in esm; this is make space for a future with esm4
esm typo

esm typo
2022-01-23 17:04:48 +01:00
elsid 5a6b39f8e0 Store mesh source data in recast mesh 2021-12-10 23:55:02 +01:00
elsid 7dcb219ecf Add raw heightfield data to navigator 2021-12-03 01:16:15 +01:00
elsid 8571c317d8 Add raw water data to navigator 2021-12-03 01:16:15 +01:00
elsid 9a5ec5fd03 Store heightfields as array of heights instead of triangles
To reduce size of RecastMesh and therefore cache size.
2021-07-26 00:22:21 +02:00
elsid 28b2f769c2 Update navmeshtilescache benchmark generators 2021-07-26 00:22:21 +02:00
elsid 5d6c93566d Rename DetourNavigator::Water -> Cell 2021-07-26 00:22:21 +02:00
elsid 753767d6d9 Store only water shift
Rotation is not used.
2021-07-26 00:22:20 +02:00
elsid a1549321d7 Move Water struct out of RecastMesh class 2021-07-26 00:22:20 +02:00
elsid af7059373c Make RecastMesh independent from the order of RecastMeshBuilder calls
To make sure RecastMesh objects are equal if built with the same data but in
different order. Will be used later when there will be more than one place
building RecasMesh objects.
2021-07-26 00:22:20 +02:00
elsid beeb882ea8 Do not use off mesh connections as a part of navmesh cache key
To reduce cache size and make it more flexible.

Adding off mesh connections to the navmesh is the last step of navmesh
generation and it's very fast comparing to other steps (microseconds vs
milliseconds). Having less cache size makes get and set operations almost 2x
times faster that also have an order of microseconds. So in total there is
no performance impact.
2021-07-14 12:19:17 +02:00
elsid 6128fcfc82 Use empty off mesh connections in benchmark
To get proper comparison with the next change removing it from the cache key.
2021-07-14 00:01:46 +02:00
elsid d85cbe4069 Support system Google Benchmark 2021-07-06 19:33:26 +02:00
elsid 7498a86abe Remove redundant semicolons 2021-07-05 13:11:54 +02:00
elsid 4d7e5245a3 Support benchmarks for windows
Don't run the binary because gitlab can't execute it successfully due to
unknown reason.
2021-05-11 13:16:59 +02:00
elsid ec87b3f8f7 Remove redundant ChunkyTriMesh
This AABB tree required when need to filter out input mesh that has not
influence navmesh tile output. This filtering is already done before. Each
recast mesh corresponds to a single navmesh tile and has appropriate bounds.
2021-05-04 13:00:06 +02:00
elsid b9a40bc5fc Add NavMeshTilesCache benchmarks 2021-03-25 19:28:41 +01:00