Checking
if(x in something.vars)
This is the same proc (see code snippet) under 514.1589:
And 515.1637:
Numbered Steps to Reproduce Problem:
1. Benchmark
if(variable in something.vars)
2. Benchmark
if(variable in something.vars)
3. Observe that 515.1637 takes 8x longer
Code Snippet (if applicable) to Reproduce Problem:
https://github.com/sojourn-13/sojourn-station/blob/ 01e70d053489efbbfce481f85b05dfcc4ab398ab/code/modules/ projectiles/gun_firemode.dm
/datum/firemode/proc/apply_to(obj/item/gun/_gun)
// ...
for(var/propname in settings)
if(propname in gun.vars)
gun.vars[propname] = settings[propname]
Expected Results:
Checking x in vars would be of similar speed
Actual Results:
Checking x in vars is 8x slower
Does the problem occur:
Every time? Or how often? Always
In other games? Presumably
In other user accounts? Didn't test
On other computers? Yes
When does the problem NOT occur?
It always occurs on the given BYOND versions
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
514.1589 - Have not tested any versions between 514.1589 and 515.1637
Workarounds:
/datum/firemode/proc/apply_to(obj/item/gun/_gun)
for(var/propname in settings)
try
gun.vars[propname] = settings[propname]
catch
// ignore error
The code governing "in vars" hasn't changed between 514 and 515, so some other factor has to be in play.