Page 1 of 1

The death of lag

Posted: Sun Mar 13, 2016 3:37 pm
by Not-Dorsidarf
Image

Everyone clap for MSO, our new overlord eternal.

Re: The death of lag

Posted: Sun Mar 13, 2016 3:38 pm
by Remie Richards
Dont forget lummox, who gave us the variable necessary to do this decently.

Re: The death of lag

Posted: Sun Mar 13, 2016 4:04 pm
by Ikarrus
This is what they said when we fixed atmos lag back in our own r4407

Give it a year or so and the lag will be back. It'd not dead, just temporarily inconvenienced.

Re: The death of lag

Posted: Sun Mar 13, 2016 4:05 pm
by Steelpoint
Isn't the problem with lag more that once we finally get it under control, new people come in and shove as much content in that taxes the game to the point where lag becomes a problem again?

I heard someone mention that on IRC/OOC once, or multiple times.

Re: The death of lag

Posted: Sun Mar 13, 2016 4:15 pm
by Remie Richards
This isn't /that/ kind of lag fix.
CPU getting to 100% is not a common occurence anymore.
It took:
all turfs being active (atmos processing)
6 singulos
and a bunch of 12,something,something bombs

all of this shit at once, to cause any noticable lag.
this is not something that will degrade as more content is added, provided people actually use the things being added (CHECK_TICK in expensive loops, etc.)

Re: The death of lag

Posted: Sun Mar 13, 2016 4:57 pm
by Venticular
Remie Richards wrote:This isn't /that/ kind of lag fix.
CPU getting to 100% is not a common occurence anymore.
It took:
all turfs being active (atmos processing)
6 singulos
and a bunch of 12,something,something bombs

all of this shit at once, to cause any noticable lag.
this is not something that will degrade as more content is added, provided people actually use the things being added (CHECK_TICK in expensive loops, etc.)
Holy shit mother of lag fixes

Even my dirtOS can run spacemans smoothly now

Re: The death of lag

Posted: Sun Mar 13, 2016 6:47 pm
by MMMiracles
an admin dropped the biggest possible explosion at the bridge and all of us were able to not only follow the the shockwave as it blew apart the station, but talk about it with no delay to the chat.

it was beautiful.

Re: The death of lag

Posted: Sun Mar 13, 2016 6:52 pm
by Venticular
MMMiracles wrote:an admin dropped the biggest possible explosion at the bridge and all of us were able to not only follow the the shockwave as it blew apart the station, but talk about it with no delay to the chat.

it was beautiful.
Before this fix I couldn't even follow where I was going sometimes because of lag

Sometimes my game would freeze and I would kill the client because it was faster than waiting for it to unfreeze

I am so happy now

Re: The death of lag

Posted: Sun Mar 13, 2016 6:53 pm
by Shaps-cloud
We had 8 teslas tearing up the station and shredding blobs at once with 0 lag, not sure if that's related to this but it was great

Re: The death of lag

Posted: Sun Mar 13, 2016 6:57 pm
by ShadowDimentio
Okay coderbus you need to stop on a high note lest you ruin this like so many other things

Also this was fixed with just one variable?

Re: The death of lag

Posted: Sun Mar 13, 2016 6:57 pm
by Venticular
wait, so first we had Kor's lava land lag a few days ago
This was caused by ruin lag

Then we have the lag round where time was at 1/3 speed, and also lag ops

Then a few days later we get this lag fix

COINCIDENCE? I THINK NOT
ADMIN AGENDA CONFIRMED
ITS ALL BEEN A LIE

Re: The death of lag

Posted: Sun Mar 13, 2016 8:04 pm
by oranges
It lets us move processing of items across multiple ticks to spread load - the nice thing is it's still usually not noticeable to players that this is occuring.

we just don't want to rely on it too "too" much since it will cause a different kind of lag where large events just take longer to complete

Re: The death of lag

Posted: Sun Mar 13, 2016 8:33 pm
by PKPenguin321
ShadowDimentio wrote:Okay coderbus you need to stop on a high note lest you ruin this like so many other things

Also this was fixed with just one variable?
no

Re: The death of lag

Posted: Sun Mar 13, 2016 10:39 pm
by Atlanta-Ned
Joke's on you the lag's worse than ever.

Re: The death of lag

Posted: Sun Mar 13, 2016 10:47 pm
by PKPenguin321
Atlanta-Ned wrote:Joke's on you the lag's worse than ever.
its not merged yet

Re: The death of lag

Posted: Mon Mar 14, 2016 8:51 am
by MrStonedOne
its in sybil, test merged.

This fixes cpu lag only, where something taking so long prevents byond from sending out map updates to clients.

This doesn't fix network lag, but that was rarely an issue.

Basically, 510 has a way to see if something is about to overrun a byond tick (the cause of lag) so now we can make subsystems (like atmos) that check for this and say "ok, we are about to cause byond to miss the next tick, lets pause for a tick and resume at the start of next tick"

We can also think ahead with this and track how much of a tick each subsystem uses on avg, and if say only 20% of the tick remains, prioritize running subsystems that won't use more than 20% of a tick on avg. (something the mc has been doing for weeks now).


Full info:

510 has a new var, called world.tick_usage - This tells you how far we are into the current tick (in percents).

So now you can dynamically see what percent of a tick you have left, and just do something like if (world.tick_usage > 85) sleep(world.tick_lag)
(or what ever percentage of buffer you want to have.)

The other thing you can do that we do (The mc has been doing this for about a month) is track the tick_usage of each subsystem (var/tickusage = world.tick_usage, subsystem.run(), subsystem.tickusage = tickusage - world.tick_usage) and only run a subsystem if there is enough time left in the tick. (if (world.tick_usage + subsystem.tickusage < 80) subsystem.run())

Re: The death of lag

Posted: Mon Mar 14, 2016 4:34 pm
by Grazyn
crosspost from OOC:

MAKE NUKE ACTUALLY EXPLODE

Re: The death of lag

Posted: Mon Mar 14, 2016 4:38 pm
by Wyzack
That would be cool. At the very least mass delete everything on the station z

Re: The death of lag

Posted: Mon Mar 14, 2016 4:46 pm
by Venticular
nuke will be a 255/255/255

fridges may protect you from all explosions

prepare setting up the bomb then stuffing all the nuke ops into a fridge

Re: The death of lag

Posted: Tue Mar 15, 2016 1:57 pm
by MrStonedOne
Lag is offically dead.

We can work on making the nuke use a real explosion in another pr, i didn't want that to bog down this one.

Re: The death of lag

Posted: Tue Mar 15, 2016 2:24 pm
by Lumbermancer
Singulo is surprisingly not laggy. It just pauses for a second now and then to regain its composure, and then continues to eat stuff.

Re: The death of lag

Posted: Tue Mar 15, 2016 2:25 pm
by Archie700
MrStonedOne wrote:Lag is offically dead.

We can work on making the nuke use a real explosion in another pr, i didn't want that to bog down this one.
Observed a meteor round, can confirm that MSO murdered lag and tossed its body to the dogs.

Re: The death of lag

Posted: Fri Mar 18, 2016 12:04 am
by Luke Cox
Real nuke explosion when

Re: The death of lag

Posted: Sun Mar 20, 2016 9:58 am
by MrStonedOne
I'm trying to find a way to do real nuke explosions that doesn't take forever to process.

I have a few ideas, but they will have to wait for 510 to become stable, as i need to re-write the MC to be a bit more flexible and powerful with how it allocates cpu time

Re: The death of lag

Posted: Sun Mar 20, 2016 11:24 am
by Saegrimr
Goon's got a /proc/creepify_station() that pulls up all the floor tiles and replaces it with the damage sprites, busts machinery shit but doesn't actually destroy any tiles/walls/windows. Might work but kinda lame without actual destroyed tiles.

Re: The death of lag

Posted: Sun Mar 20, 2016 11:26 am
by oranges
In the tests I was doing the major hold for mega bombs was the intial calculations when teh bomb first went off. Once it just started rolling the explosive wave outwards it ticked over fine.

Spiral range ran into proc limits and got backgrounded.

Re: The death of lag

Posted: Sun Mar 20, 2016 3:41 pm
by MrStonedOne
I have a nice way i could make this work, but the best way also requires making the mc halt all processing except for ticker, and making the tick checker not resumed paused ticks for other shit, to basically give this thing 100% priority.

thats a bit snowflakly and hacky, so i'm gonna make a system genericize that concept, but it might be better to work into my MC rewrite that includes removing dynamic wait and making subsystem flags for things like priority and timing dependence level, and that i have on hold until 509 support is dropped so i can remove dynamic wait entirely.

Re: The death of lag

Posted: Sun Mar 20, 2016 9:07 pm
by oranges
with some of the stuff I have merged right now we have no 509 support

Re: The death of lag

Posted: Thu Mar 24, 2016 5:41 pm
by MrStonedOne
oranges wrote:with some of the stuff I have merged right now we have no 509 support
I fixed that.

Re: The death of lag

Posted: Sun Mar 27, 2016 5:33 am
by callanrockslol
I grew ten thousand plants and lagged the station to shit lag is still real.

Re: The death of lag

Posted: Mon Mar 28, 2016 3:27 am
by MrStonedOne
callanrockslol wrote:I grew ten thousand plants and lagged the station to shit lag is still real.
What plants, I'll go remove the lag from them

Re: The death of lag

Posted: Mon Mar 28, 2016 3:28 am
by ShadowDimentio
We lag weeding boys

Re: The death of lag

Posted: Mon Mar 28, 2016 4:23 am
by callanrockslol
MrStonedOne wrote:
callanrockslol wrote:I grew ten thousand plants and lagged the station to shit lag is still real.
What plants, I'll go remove the lag from them
All of them.

Re: The death of lag

Posted: Mon Mar 28, 2016 9:20 pm
by MrStonedOne
I need at least one example.

Re: The death of lag

Posted: Mon Mar 28, 2016 10:26 pm
by PKPenguin321
MrStonedOne wrote:I need at least one example.
i think it's just that he spawned like a billion objects (probably happened during the first few tests of remie's bees, since they were OP and could like quadruple your production). i doubt it's anything specific. it'd be like suddenly spawning 80,000 instances of any other object in the same general area, it will lag no matter what the object is.

Re: The death of lag

Posted: Tue Mar 29, 2016 11:14 am
by callanrockslol
PKPenguin321 wrote:
MrStonedOne wrote:I need at least one example.
i think it's just that he spawned like a billion objects (probably happened during the first few tests of remie's bees, since they were OP and could like quadruple your production). i doubt it's anything specific. it'd be like suddenly spawning 80,000 instances of any other object in the same general area, it will lag no matter what the object is.
It was actually after the bee nerf.