replace Resolved with ResolvedAt to reduce amount call to time.Now()#4119
Conversation
bfe9b6b to
7f0c30b
Compare
…me.Now() to 1 per iteration Signed-off-by: Evgeny Kuzin <evgeny.kuzin@outlook.com>
7f0c30b to
7f5c8ff
Compare
|
@w0rm WDYT? |
|
Seems reasonable to me. What does the profile look like with the change? |
|
@grobinson-grafana thx for taking a look! |
|
I suppose we can go further and replace this comparison https://github.com/prometheus/alertmanager/pull/4119/files#diff-279dfe3df5d26e996ad18fe4a97c9dea0c7c4d5079c11c96d4a4644e942602dfL240 with something better. We already using FNV-1A fingerprint and comparing uint64 instead of strings would dramatically improve this other bit where we waste tonn of time (runtime.mapaccess1_faststr ). But for now I just want this quick win. |
|
Regarding the failed test. it seems like this is not enough for alertmannger to start on CI? Do I need to fix it? |
|
I would benchmark the difference between |
|
fair enough. Anyway, I didnt plan to include this in the current PR. Does this look like it can be accepted by any chance? |
|
@SuperQ can it be merged? Whats the process? |
|
I would like one of the Alertmanager maintainers to look at this before merging. |
|
I suppose santa won't come this year, shame. Merry christmas! |
|
LGTM! Thanks for your contribution! |

with big number of inhibitions I see pretty bad picture when we spend plenty of time in time.Now()

This can be fixed by calling it once per
hasEqual