Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This run, in coderbus: https://discord.com/channels/484170914754330625/487268744419344384/1398185168891805758
- /*
- Warning: "shell none" command in the profile file is done by default; the command will be deprecated
- Fri Jul 25 08:08:38 2025
- World opened on network port 34013.
- Welcome BYOND! (5.0 Public Version 516.1661)
- normal_list.len got 1249587 iterations in 0.5 seconds!
- length(normal list) got 1253465 iterations in 0.5 seconds!
- length(contents) got 788957 iterations in 0.5 seconds!
- contents list.len got 675388 iterations in 0.5 seconds!
- length(txt string) got 1230861 iterations in 0.5 seconds!
- The BYOND hub reports that port 34013 is not reachable.
- */
- // BENCHMARK CODE - from coderbus https://discord.com/channels/484170914754330625/487268744419344384/1005309051791491193
- #define BENCHMARK_RESET iterations = 0; end_time = world.timeofday + duration;
- #define BENCHMARK_LOOP BENCHMARK_RESET; while(world.timeofday < end_time)
- #define BENCHMARK_MESSAGE(msg) world.log << "[msg] got [iterations] iterations in [seconds] seconds!"; BENCHMARK_RESET
- #define SECONDS *10
- /atom/movable
- var/list/normal_list = list()
- var/txt = ""
- /world
- loop_checks = FALSE
- /proc/main(seconds = 0.5)
- var/duration = seconds SECONDS
- var/iterations = 0
- var/end_time = 0
- var/atom/movable/thingy = new()
- for(var/i in 1 to 100)
- if(prob(50))
- new/atom/movable(thingy)
- else
- new/mob(thingy)
- thingy.normal_list += i
- thingy.txt = "[thingy.txt]A"
- BENCHMARK_LOOP
- var/x = thingy.normal_list.len
- var/y = x + 1
- iterations++
- BENCHMARK_MESSAGE("normal_list.len")
- BENCHMARK_LOOP
- var/x = length(thingy.normal_list)
- var/y = x + 1
- iterations++
- BENCHMARK_MESSAGE("length(normal list)")
- BENCHMARK_LOOP
- var/x = length(thingy.contents)
- var/y = x + 1
- iterations++
- BENCHMARK_MESSAGE("length(contents)")
- BENCHMARK_LOOP
- var/x = thingy.contents.len
- var/y = x + 1
- iterations++
- BENCHMARK_MESSAGE("contents list.len")
- BENCHMARK_LOOP
- var/x = length(thingy.txt)
- var/y = x + 1
- iterations++
- BENCHMARK_MESSAGE("length(txt string)")
Advertisement
Add Comment
Please, Sign In to add comment