Skip to content

Instantly share code, notes, and snippets.

View MrStonedOne's full-sized avatar
🎯
Focusing

Kyle Spier-Swenson MrStonedOne

🎯
Focusing
View GitHub Profile
@MrStonedOne
MrStonedOne / 0-runtime-LOWMEMORYMODE-z1-only.mem.txt
Created June 3, 2018 09:55
Memory usage. Only non-zero entries.
mem:Research(init):218877952-218513408=364544
mem:Events(init):219054080-218877952=176128
mem:Ticker(init):219185152-219054080=131072
mem:_maps/map_files/debug/runtimestation.dmm(mapload):219267072-219185152=81920
mem:_maps/map_files/debug/runtimestation.dmm(mapload):232235008-230727680=1507328
mem:_maps/RandomRuins/SpaceRuins/derelict6.dmm(mapload):233132032-233123840=8192
mem:_maps/shuttles/emergency_arena.dmm(mapload):233136128-233132032=4096
mem:/turf/closed/wall/r_wall(new()):208896
mem:/obj/machinery/light(new()):65536
mem:/obj/machinery/airalarm/unlocked(new()):65536

server mem usage:

Prototypes:

  • obj: 2156 (20)
  • mob: 2172 (1)
  • proc: 7452 (53)
  • str: 16496 (586)
  • appearance: 17576 (5)
  • id array: 10580 (117)
  • map: 8248 (255,255,0)
/world/turf = /turf/open/space/basic
/turf
icon = 'space.dmi'
icon_state = "0"
name = "\proper space"
var/intact = 0
plane = -95
layer = 8.5
var bv1 = 91.21312
var bv12 = 91.21323
//the final number in a line is the usage, the previous numbers are the after and before total memory usage
mem:_maps/map_files/MetaStation/MetaStation.dmm(mapload):229.46MB-227.61MB=1.85MB
mem:_maps/map_files/MetaStation/MetaStation.dmm(mapload):255.37MB-230.09MB=25.29MB
mem:_maps/map_files/Mining/Lavaland.dmm(mapload):255.38MB-256.96MB=-1.65478e+006B
mem:_maps/map_files/Mining/Lavaland.dmm(mapload):290.12MB-255.87MB=34.25MB
mem:_maps/map_files/generic/City_of_Cogs.dmm(mapload):293.19MB-291.14MB=2.05MB
mem:_maps/RandomRuins/SpaceRuins/spacehotel.dmm(mapload):301.45MB-299.93MB=1.52MB
mem:/turf/closed/mineral(new()):27.61MB
mem:/turf/closed/mineral/random(new()):27.61MB
[2018-07-08 02:41:56.058] ### VarEdit by MrStonedOne/(MrStonedOne): /datum/controller/subsystem/timer last_invoke_tick=13689.5 => 1
[2018-07-08 02:41:56.070] ## WARNING: No regular timers processed in the last 600 ticks, resetting buckets! in code/controllers/subsystem/timer.dm at line 51 src: Timer usr: .
[2018-07-08 02:41:56.071] Timer bucket reset. world.time: 13698.5, head_offset: 12600, practical_offset: 1017
[2018-07-08 02:41:56.073] Active timers at index 24:
[2018-07-08 02:41:56.075] Timer: Timer: 22702 ([0x210c120b]), TTR: 13211.5, Flags: TIMER_STOPPABLE, callBack: [0x2111a14f], callBack.object: some_magic_bullshit[0x600037f](GLOBAL_PROC), callBack.delegate:/proc/qdel(the green laser)Prev: NULL, Next: NULL
[2018-07-08 02:41:56.077] Active timers at index 60:
[2018-07-08 02:41:56.077] Timer: Timer: 22733 ([0x21138387]), TTR: 13229.5, Flags: TIMER_STOPPABLE, callBack: [0x2112fd6f], callBack.object: some_magic_bullshit[0x600037f](GLOBAL_PROC), callBack.delegate:/proc/qdel(the green laser)Prev: Timer: 22
#!/bin/bash
cd ~/git/tgstation
git fetch
git reset --hard origin/master
git clean -df
DreamMaker -o tgstation.dme > ~/web/public/objecttree.xml
zip -jD9 /home/static/web/public/byond/tgstation.zip tgstation.rsc
mkdir -p /home/static/web/public/nightlies/$(date '+%Y/%m')
Sample Size = 100000
List of lists, before fill: 824kb - 8.44b
List of lists, after fill: 3.98mb - 41.74b
List of datums, before fill: 784kb - 8.03b
List of datums, after fill: 3.86mb - 40.47b
List of strings, before fill: 784kb - 8.03b
List of strings, after fill: 15.66mb - 164.21b
Assoicated list of strings, before fill: 784kb - 8.03b
Assoicated list of strings, after fill: 18.43mb - 193.29b
@MrStonedOne
MrStonedOne / _output.txt
Last active September 23, 2018 22:42
Memory usage stats of different collections in BYOND
Sample Size = 500000
Starting Usage = 39.09mb
List of lists, before fill: 42.96mb Diff:3.87mb Each:8.12b
List of lists, after fill: 61.04mb Diff:18.08mb - 37.92b
List of datums, before fill: 64.87mb Diff:3.82mb Each:8.02b
List of datums, after fill: 83.14mb Diff:18.27mb Each:38.32b
List of strings, before fill: 86.96mb Diff:3.82mb Each:8.01b
List of strings, after fill: 162.11mb Diff:75.14mb Each:157.59b
List of strings, preloaded string tree, before fill: 165.93mb Diff:3.83mb Each:8.03b
List of strings, preloaded string tree, after fill: 165.94mb Diff:4kb Each:0.01b
@MrStonedOne
MrStonedOne / code.dm
Created December 30, 2018 09:23
object defined template language preview
/client/verb/Display_Tokens()
var/list/characterMappings = list()
for (var/type in typesof(/datum/templateToken))
var/datum/templateToken/tType = type
var/character = initial(tType.character)
var/word = initial(tType.word)
if (isnull(character))
continue
//Blocks an attempt to connect before even creating our client datum thing.
//How many new ckey matches before we revert the stickyban to it's roundstart state
//These are exclusive, so once it goes over one of these numbers, it reverts the ban
#define STICKYBAN_MAX_MATCHES 20
#define STICKYBAN_MAX_EXISTING_USER_MATCHES 5 //ie, users who were connected before the ban triggered
#define STICKYBAN_MAX_ADMIN_MATCHES 2
/world/IsBanned(key,address,computer_id,type,real_bans_only=FALSE)
log_connection_debug("[.....]([args.Join(", ")]): Start")