Skip to content
Permalink
Browse files

LosHandler: speedup + threading

A few numbers of a 1min 400 fighter testcase:
time spend in LosHandler: 20sec (before this commit) -> 15sec (singlethreaded) -> 8sec (threaded with a quadcore)

What has been done:
* decouple unit update from LosInstance update
* optimize LosInstance update (when an instance is removed from an unit and added to another in the same gameframe, then the losmap doesn't need to get updated, etc.)
* increased cache again
* use boost::unordered_multimap instead of custom hash array
* Run Length Enode `squares` map of SLosInstance to reduce memory consumption a lot
* threaded LosTypes updating (Radar, LoS, AirLoS, ... are updated in parallel)
* threaded terrain raycasting
  • Loading branch information...
jK
jK committed Oct 13, 2015
1 parent ca3e86b commit 2635f8cd955da553e74adecc6e2bbbd4d4b762b1
Showing with 492 additions and 217 deletions.
  1. +289 −122 rts/Sim/Misc/LosHandler.cpp
  2. +40 −18 rts/Sim/Misc/LosHandler.h
  3. +132 −72 rts/Sim/Misc/LosMap.cpp
  4. +8 −5 rts/Sim/Misc/LosMap.h
  5. +23 −0 rts/System/Threading/SpringMutex.h
Oops, something went wrong.

2 comments on commit 2635f8c

@jk3064

This comment has been minimized.

Copy link
Member

replied Oct 13, 2015

@ashdnazg

This comment has been minimized.

Copy link
Member

replied Oct 13, 2015

very nice!

Please sign in to comment.
You can’t perform that action at this time.