Skip to content

Commit

Permalink
Stop turn slowdown (#857)
Browse files Browse the repository at this point in the history
* Identified a potential point of slowdown

Turn processing is already done concurrently, but data fetching for all the workers was not, so i have changed this in the hopes it will speed up turn times and the number of users increases.

* Rethinking approach

difficult to implement concurrent solution to the code in question, rethinking approach.

* Added comments to where things need changing

added a couple of comments to explain what need's to be done in various places that i've identified that could slow down turns.

* Turn times had been sped up

Solution has been to create a timed process populated with daemon threads, this forces the main source of the slowdown into a 2 second window. However this has highlighted a big issue, the requests take more than 2 seconds a significant proportion of the time and as a result many actions become wait actions, also there needs to be a degree of garbage collection to prevent the creation of a potentially server ending amount of processes

* Cleanup

game runs turns at consistent 3 seconds locally even with 10 people, which in the past seem to cause the game to crash. Avatars seem to be able to respond in the 2 second limit, however we may want to increase this duration to make it more reliable.

* Merge branch 'development' into stop_turn_slowdown

* update version

* Minor changes

* Grammar changes

* reviewable changes

* Bump version number

* Reviewable changes++

* Merge branch 'development' into stop_turn_slowdown

* pep8

* Merge remote-tracking branch 'origin/stop_turn_slowdown' into stop_turn_slowdown
  • Loading branch information
TheseusGrey committed Oct 17, 2018
1 parent 6488e91 commit 9ec7a3a
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 96 deletions.
206 changes: 115 additions & 91 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion aimmo-game/simulation/worker.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging

import requests

LOGGER = logging.getLogger(__name__)


Expand Down
Loading

0 comments on commit 9ec7a3a

Please sign in to comment.