Commit Graph

52 Commits

Author SHA1 Message Date
Kyle Spier-Swenson
2b86b39747 More timer debugging for the debug gods. (#30436)
* More timer debugging for the debug gods.

* Its times like this I wish I could amend commit from the web interface

* git commit -a -amend&&git push --force
2017-09-07 10:58:22 -04:00
Jordan Brown
cd912faf59 Unifies datum definitions 2017-08-01 15:51:26 -04:00
pigeons
4e05dd63f9 Fixes timer id collision (#29437)
The list of active timers timer_id_dict identifies timers by their numerical id as a string. However this was done using embedded expressions inside the string, which calls num2text with a default of 6 significant figures. This means anything at or above 1 million is expressed in scientific notation.

"timer[1000000]" -> "timer1e+06"
"timer[1000001]" -> "timer1e+06"

Calling num2text manually with 8 significant figures kicks the collision problem down the road to 2^24 (16 million).

nextid is now selectively incremented and is looped back to 1 when reaching the 2^24 threshold.
Also now includes collision checking.
2017-07-26 11:48:21 +12:00
Kyle Spier-Swenson
eeab8f71bb Make timer debug info more robust (#29100)
* Make timer debug info more robust

* Update timer.dm

* Update timer.dm

* Update timer.dm

* Update timer.dm

* Update timer.dm

* Update timer.dm

* Update timer.dm
2017-07-07 22:18:44 -04:00
Jordan Brown
a8dffe5eb2 Adds warning for misuse of deltimer 2017-06-14 16:07:29 -04:00
Cyberboss
a0a27219b6 MC Runlevels 2017-05-10 16:05:37 -04:00
Jack Edge
a76d4374c1 Moves init_order to defines, moves SSevents above ticker. 2017-04-22 22:08:31 +01:00
Cyberboss
9c9673fe45 Adds a crash log and recovery for hanging SStimer 2017-04-03 19:47:42 -04:00
Cyberboss
fb596bcdb3 _DEF 2017-03-22 14:52:21 -04:00
Cyberboss
7e14ec75fc Normalizes subsystem definitions 2017-03-22 11:50:46 -04:00
kevinz000
51d3cd11f5 [READY]Refactors beams to use timers for recalculation, and new beam proc after drawing (#25252)
* now with timers!

* woops

* hmm this is better

* stoppable timers

* more timer stuff

* fix

* fix
2017-03-22 22:19:16 +13:00
Cyberboss
31ee152489 Repaths subsystem to controller/subsystem (#24624)
* Repaths subsystem to controller/subsystem

* Fix the shit
2017-03-08 22:05:45 +01:00
Cyberboss
4d78f4e3d4 Somehow missed timer 2017-03-02 16:24:10 -05:00
Cyberboss
ec8c42bbff Sorted client time timers 2017-02-21 09:46:50 -05:00
oranges
edebf05394 Merge pull request #24114 from Cyberboss/addtimerflag
Adds option of unique timers ignoring wait
2017-02-17 14:32:12 +13:00
Cyberboss
e806fcd11c Adds option of unique timers ignoring wait 2017-02-14 14:04:13 -05:00
Cyberboss
29bbb4d529 Makes a thing use a better define 2017-02-13 16:23:15 -05:00
Cyberboss
3fc6c07825 Makes addtimer(..., 0) more akin to spawn(0) (#23669)
* Makes addtimer(..., 0) use spawn(0)

* Jess queue it

* No negative times
2017-02-06 10:23:45 +13:00
Cyberboss
b86e224571 Makes qdeleted and qdestroying macros (#23666)
* Makes qdeleted and qdestroying macros

* Makes QDELETED and QDESTROYING uppercase

* Swap qdel checks istype's for != null's

* Fix it

* How was this missed?
2017-02-06 00:59:27 +13:00
Kyle Spier-Swenson
068eb07473 Fixes freon/ice causing lag (#23493)
* Fixes freon causing lag

Yes, these were stacking. so a turf would have a bunch of "handle wet" timers running on it, every 1.5 seconds, all checking the same shit.

* Fixes unique timers
2017-02-03 10:28:14 +13:00
MrStonedOne
dbb4623440 Cleans up timer handling. 2017-01-30 03:38:13 -08:00
MrStonedOne
aad8724558 This is better (proper resuming support) 2017-01-24 15:38:48 -08:00
Kyle Spier-Swenson
9f2374f220 Fix warning 2017-01-23 00:34:50 -08:00
Kyle Spier-Swenson
96aa691d9a Makes the timer subsystem less chinsky at the cost of performance
Making timers run thru qdel will be a cost a pretty fair chunk of resources, and will very likely flood the qdel controller, but it should do for now until i figure out why they randomly decide to stop qdeling.

Also, changes the only thing i think could be an issue causing references to not get cleaned up to be less lean and more forgiving.

I'll revisit this at some point and see if i can't figure this out.
2017-01-22 23:00:39 -08:00
Kyle Spier-Swenson
32c8e178bf Fixes timers not GCing 2017-01-21 20:00:46 -08:00
Kyle Spier-Swenson
c341178ff4 Fixes bug with addtimer keeping old timers around, makes addtimer even faster. (#23126)
* Fixes timers being left around, Makes addtimer() sanic fast.

This adds a new flag, TIMER_STOPPABLE. Most(80%) of the overhead for addtimer() was in adding the timer to the associated lookup list for deltimer() to use. Moving that functionality to a flag so it wouldn't slow down the 70% of things calling timers puts the final nail in the coffin of byond's sleep/spawn().

spawn: 324 seconds across 5,948,372 calls

addtimer: 67 seconds across 5,953,220 calls

The testing setup for profiling was included in this commit, it will be removed in a later commit. @Fox-McCloud

* Remove profiling procs.

* fix runtime

luckly when this happened, we were about to resume anyways.
2017-01-20 09:31:50 +01:00
MrStonedOne
01e8fc6fbc Fixes timers cleaning up oddly in certain edge cases. 2017-01-17 00:12:29 -08:00
MrStonedOne
c8d4ed5cfd Some more improvements and overhead shaving. 2017-01-16 12:56:48 -08:00
MrStonedOne
15e69deadc Remove a debug line and reword a crash 2017-01-16 12:56:48 -08:00
MrStonedOne
3f75fdb42d Addtimer refactor: Officially faster then byond's internal sleep system 2017-01-16 12:56:48 -08:00
Kyle Spier-Swenson
bee4b132a3 [READY]Makes addtimer use callbacks (#22660)
* Makes addtimer use callbacks

* I broke the comment

* I fucked up the regex

* this was a silly idea.
2017-01-04 16:02:56 +13:00
Cyberboss
51c463815d Better addtimer logging 2016-12-04 01:17:09 -05:00
Kyle Spier-Swenson
0ed1c63066 Fixes a small oversight in timer subsystem
hashlist was designed to ensure that timers on different objects with the same name didn't get detected as the same timer, but when I added it, i forgot to make this line actually use the hashlist.
2016-11-30 14:43:09 -08:00
Cyberboss
e37f807941 Fixes the false armblade removal timer. Refactors addtimer (#21714)
* Clever girl...

* Make the addtimer unique param safe

* Refactor addtimer calls

* Moved the location of the define so the other SSs can use it
2016-11-25 22:05:58 +13:00
oranges
a62066ebe4 Merge pull request #18727 from RemieRichards/global_procs_in_addtimer
You can now call global procs with addtimer()
2016-06-21 10:18:49 +12:00
Remie Richards
b0634d3227 istext() check on procToCall 2016-06-20 23:06:51 +01:00
Kyle Spier-Swenson
b05886a132 sstimer: Does a thing in a less retarded way. 2016-06-18 21:14:25 -07:00
Remie Richards
0422a46fbb You can now call global procs with addtimer(), by supplying the object as GLOBAL_PROC, a special define that tells the timing subsystem to use a different call()() syntax (the syntax that supports global procs) 2016-06-19 00:40:04 +01:00
Kyle Spier-Swenson
235b79fb5a StonedMC, the bastard love child of GoonPS and CarnMC (#17987)
Basically, they key difference between StonedMC and CarnMC is that when multiple ticks want to run at the same byond tick, we divvy up the tick between the subsystems, rather then allow one subsystem to hog it all.

The key difference between StonedMC and GoonPS is that we allow the subsystems to tell us how to divvy up the tick using flags and priority.

The new SS_ flags allows us to select behaviors that used to be piggybacked as side effects of dynamic wait or default but sometimes unneeded behavior.

Dynamic wait is 100% gone, lower priority and SS_BACKGROUND are better more refined ways of doing this when combined with MC_TICK_CHECK

I have by design never looked at the inners of goonPS, so this is all original code but I know it uses two loops because of comments by goon devs on reddit threads, that design didn't make sense before, but when I can tell a SS how much of a byond tick it is allowed to have, knowing how many need to run this tick is helpful I also know a bit more about how it works from piecing together comments in #vgstation.

Detailed list of changes:

Subsystems now have flags, allowing fine grain control over things like rather or not it processes, inits, rather it's wait is how long between runs (post run timing) or how long between starts, and rather or not late fires should cause the next fire to be earlier.

Mc now has two loops One loop handles queuing shit, one loop handles running shit.

MC now splits up tick allotment rather than first come first serve Subsystems can even request a bigger share using higher priorities. (It will even resume subsystems it paused if other subsystems hadn't used as much as it predicted they might need)

Default fps is now 20 This is related enough to the MC and it's a change that's really long since over due

All code oddities are most likely to be necessities to lower overhead on the mc since it runs every tick
2016-06-16 18:01:16 +12:00
Bjorn Neergaard
063dd9fb84 Get the code running on 510
* Travis for 510
* Remove json, list2text, text2list, bygex
* Change blind and click catcher to a low plane
2016-02-04 17:19:40 -06:00
Bjorn Neergaard
2f46b224ae Fix air alarm hacking, raise SStimer display 2016-01-25 12:03:00 -06:00
Bjorn Neergaard
dbc64b7d28 tgui fire alarms 2016-01-25 12:02:59 -06:00
xxalpha
9377ec8423 Changed /datum/timedevent Destroy() to return QDEL_HINT_IWILLGC 2016-01-21 19:25:23 +00:00
MrStonedOne
b50e8d2a63 removes a bunch of unneeded spawns
spawns have a high overhead.

I only went for easy targets, almost every spawn could be removed with a few subsystems in place to handle delays or cooldowns
2016-01-02 18:23:02 -08:00
Bjorn Neergaard
71d96ba35f Fix error in SStimer arguments
It still works because... luck? The only thing that uses this is the
Crew Monitor which sends a Z-level as the argument... Which happens to
work because the Z-level is usually 1.
2015-12-03 09:35:23 -06:00
Bjorn Neergaard
6ec257c360 Hotfix for SStimer lag
SStimer can now check dupes
Also fix ghosts not being inquisitive with objects...
2015-12-02 21:23:45 -05:00
Bjorn Neergaard
aadfa979e6 Blame MSO
@MrStonedOne
2015-11-30 21:23:57 -05:00
Bjorn Neergaard
47e9a7771a Fix up SStimer, make Crew Console use SStimer
Remove crappy proc queue as well...
2015-11-30 20:56:45 -05:00
duncathan
51c09f16bf makes all Destroy()'s return properly 2015-08-31 00:21:01 -06:00
Firecage
4688c2c969 Fixes proc arguments 2015-07-15 23:52:35 +02:00