Commit Graph
5 Commits
Author SHA1 Message Date
norsvenskaandSkyratBot aefec7cb2b Corrects 200+ instances of "it's" where it should've been "its" instead (#85169)
## About The Pull Request

it's - conjunction of "it" and "is"
its - possessive form of "it"

grammar is hard, and there were a lot of places where "it's" was used
where it shouldn't have been. i went and painstakingly searched the
entire repository for these instances, spending a few hours on it. i
completely ignored the changelog archive, and i may have missed some
outliers. most player-facing ones should be corrected, though
## Why It's Good For The Game
proper grammar is good

## Changelog
🆑
spellcheck: Numerous instances of "it's" have been properly replaced
with "its"
/🆑
2024-07-21 15:47:03 -04:00
0d0ec78ef2 [MIRROR] Micro-optimizes _SendSignal a bit (#27759)
* Micro-optimizes _SendSignal a bit (#83244)

## About The Pull Request
Instead of iterating over an assoc list and doing a list access, which
has a complexity of O(nlog(n)), it is better to just store a 2 tuple and
access that to get a complexity of O(n)
Check code to see what I mean.

## Why It's Good For The Game

![image](https://github.com/tgstation/tgstation/assets/37270891/1e5d68fa-2e19-473c-a870-e1e0277cbacc)
This is a very hot proc and it's worth micro-optimizing where we can.

The speed increase in doing the following code can be seen here:

![image](https://github.com/tgstation/tgstation/assets/37270891/1b7f00a3-b3c2-4976-b2ab-97eefbbd2459)
Higher is better.

The code that was benchmarked:
```dm
var/list/target = list()

/proc/testa()
    var/list/queued_calls = list()
    for(var/i in 1 to length(target))
        var/data = target[i]
        queued_calls.Add(data, 1)
    for(var/i in 1 to (length(queued_calls) / 2))
        var/a = queued_calls[i*2-1]
        var/b = queued_calls[i*2]

/proc/testb()
    var/list/queued_calls = list()
    for(var/data in target)
        queued_calls[data] = 1
    for(var/data in queued_calls)
        var/a = data
        var/b = queued_calls[data]

MAIN
	for(var/i in 1 to 100)
		target.Add("[i]")
    BEGIN_BENCH(2)
        BENCH_PHASE("New code", testa())
        BENCH_PHASE("Old code", testb())
    END_BENCH
```

## Changelog

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@ users.noreply.github.com>

* Micro-optimizes _SendSignal a bit

---------

Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com>
Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@ users.noreply.github.com>
2024-05-18 03:17:14 +02:00
8f50fc7434 [MIRROR] Adds the proc we're overriding to RegisterSignals's override stacktrace (#27315)
* Adds the proc we're overriding to RegisterSignals's override stacktrace (#82641)

## About The Pull Request

We get it for quite literally free, no reason not to dump it.
I always find myself checking in the debugger, which says something
about what'll happen when I don't have that again.

* Adds the proc we're overriding to RegisterSignals's override stacktrace

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
2024-04-15 22:17:33 -04:00
001ee8e609 [MIRROR] Minor signals memory optimization [MDB IGNORE] (#24552)
* Minor signals memory optimization (#79153)

This replaces the inner list of signals which tracked receivers with a
flat list instead of the previous keyed list that was used to prevent
duplicates. We have code already checking for duplicates before hand so
we can lean on that to assume the sender already has the receiver
listed. This should also be minutely more performant equal to about a
single if statement but I don't want to bother trying to profile
something so small.

* Minor signals memory optimization

---------

Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
2023-10-24 14:40:33 -04:00
6dfe17306c [MIRROR] Pulls apart the vestiges of components still hanging onto signals [MDB IGNORE] (#21738)
* Pulls apart the vestiges of components still hanging onto signals

* update modular

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Tom <8881105+tf-4@users.noreply.github.com>
2023-06-18 13:18:23 +00:00