mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 20:43:10 +01:00
Significantly speed up testing server boot (#2846)
Dramatically speeds up boot with testing (MC_TICKLIMIT_INIT > 100) configs; stoplag() would penalize procs that go over 100% tick-usage by delaying them further. This is not required during server boot & the lobby, and resulted in significantly longer boot times. This PR ports a fix from /tg/ that forces stoplag() only sleep 1 tick if it sleeps during server boot, as well as adjusting the example config to be more suited for testing.
This commit is contained in:
@@ -1182,6 +1182,12 @@ var/list/WALLITEMS = list(
|
||||
#define DELTA_CALC max(((max(world.tick_usage, world.cpu) / 100) * max(Master.sleep_delta,1)), 1)
|
||||
|
||||
/proc/stoplag()
|
||||
// If we're initializing, our tick limit might be over 100 (testing config), but stoplag() penalizes procs that go over.
|
||||
// Unfortunately, this penalty slows down init a *lot*. So, we disable it during boot and lobby, when relatively few things should be calling this.
|
||||
if (!Master || Master.initializing || !Master.round_started)
|
||||
sleep(world.tick_lag)
|
||||
return 1
|
||||
|
||||
. = 0
|
||||
var/i = 1
|
||||
do
|
||||
|
||||
@@ -46,7 +46,7 @@ var/list/gamemode_cache = list()
|
||||
var/continous_rounds = 0 // Gamemodes which end instantly will instead keep on going until the round ends by escape shuttle or nuke.
|
||||
var/allow_Metadata = 0 // Metadata is supported.
|
||||
var/popup_admin_pm = 0 //adminPMs to non-admins show in a pop-up 'reply' window when set to 1.
|
||||
var/Ticklag = 0.9
|
||||
var/Ticklag = 0.4
|
||||
var/Tickcomp = 0
|
||||
var/list/resource_urls = null
|
||||
var/antag_hud_allowed = 0 // Ghosts can turn on Antagovision to see a HUD of who is the bad guys this round.
|
||||
@@ -286,11 +286,6 @@ var/list/gamemode_cache = list()
|
||||
src.votable_modes += M.config_tag
|
||||
src.votable_modes += "secret"
|
||||
|
||||
#ifdef UNIT_TEST
|
||||
fastboot = TRUE
|
||||
world.log << "UNIT_TEST present. Forcing fastboot on."
|
||||
#endif
|
||||
|
||||
/datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist
|
||||
var/list/Lines = file2list(filename)
|
||||
|
||||
@@ -827,6 +822,7 @@ var/list/gamemode_cache = list()
|
||||
|
||||
if("fastboot")
|
||||
fastboot = TRUE
|
||||
world.log << "Fastboot is ENABLED."
|
||||
|
||||
else
|
||||
log_misc("Unknown setting in configuration: '[name]'")
|
||||
|
||||
@@ -37,6 +37,8 @@
|
||||
|
||||
shuttle_controller.setup_shuttle_docks()
|
||||
|
||||
admin_notice("<span class='notice'><b>Fastboot is enabled; some features may not be available.</b></span>", R_DEBUG)
|
||||
|
||||
..(timeofday, TRUE)
|
||||
|
||||
/proc/resort_all_areas()
|
||||
|
||||
@@ -240,11 +240,11 @@ GUEST_BAN
|
||||
|
||||
## Remove the # to allow special 'Easter-egg' events on special holidays such as seasonal holidays and stuff like 'Talk Like a Pirate Day' :3 YAARRR
|
||||
ALLOW_HOLIDAYS
|
||||
##Defines the ticklag for the world. 0.9 is the normal one, 0.5 is smoother.
|
||||
TICKLAG 0.9
|
||||
##Defines the ticklag for the world. 0.33 (30 FPS) is the normal one, though you can go as low as 0.2 (50 FPS) for low-load servers.
|
||||
TICKLAG 0.33
|
||||
|
||||
## Defines if Tick Compensation is used. It results in a minor slowdown of movement of all mobs, but attempts to result in a level movement speed across all ticks. Recommended if tickrate is lowered.
|
||||
TICKCOMP 0
|
||||
## Defines if Tick Compensation is used. It results in a minor slowdown of movement of all mobs, but attempts to result in a level movement speed across all ticks.
|
||||
#TICKCOMP
|
||||
|
||||
## Comment this out to disable automuting
|
||||
#AUTOMUTE_ON
|
||||
@@ -426,9 +426,9 @@ API_RATE_LIMIT_WHITELIST 127.0.0.1
|
||||
|
||||
# The maximum amount of a tick that the MC is permitted to use during server startup.
|
||||
# If not set will default to 98%.
|
||||
# You can set this high (~5000) for local testing to *maybe* speed up startup a bit at the cost of lagging the lobby.
|
||||
# Should be below 99 on a server actually used for play.
|
||||
#MC_TICKLIMIT_INIT 98
|
||||
# You can set this high (~500) for local testing to *maybe* speed up startup a bit at the cost of lagging the lobby.
|
||||
# -- Should be below 99 (or undefined) on a server actually used for play. --
|
||||
MC_TICKLIMIT_INIT 500
|
||||
|
||||
|
||||
## GELF Logging Configuration
|
||||
@@ -467,4 +467,4 @@ LOG_GELF_PORT 12201
|
||||
|
||||
|
||||
# Enables fastboot - some features not essential to testing (like sunlight) will be disabled to speed up server boot. Should not be used on production servers.
|
||||
# FASTBOOT
|
||||
FASTBOOT
|
||||
|
||||
Reference in New Issue
Block a user