From 4f2aa792b33fdd5fb4b22dec813b3668d7190522 Mon Sep 17 00:00:00 2001 From: kim Date: Tue, 1 Jul 2025 16:00:04 +0200 Subject: [performance] add statusfilter cache to cache calculated status filtering results (#4303) this adds another 'filter' type cache, similar to the visibility and mute caches, to cache the results of status filtering checks. for the moment this keeps all the check calls themselves within the frontend typeconversion code, but i may move this out of the typeconverter in a future PR (also removing the ErrHideStatus means of propagating a hidden status). also tweaks some of the cache invalidation hooks to not make unnecessary calls. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4303 Co-authored-by: kim Co-committed-by: kim --- internal/processing/processor.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/processing/processor.go') diff --git a/internal/processing/processor.go b/internal/processing/processor.go index 22574f1d7..c35c807e0 100644 --- a/internal/processing/processor.go +++ b/internal/processing/processor.go @@ -225,7 +225,7 @@ func NewProcessor( processor.account = account.New(&common, state, converter, mediaManager, federator, visFilter, parseMentionFunc) processor.media = media.New(&common, state, converter, federator, mediaManager, federator.TransportController()) processor.stream = stream.New(state, oauthServer) - filterCommon := filterCommon.New(state) + filterCommon := filterCommon.New(state, &processor.stream) // Instantiate the rest of the sub // processors + pin them to this struct. @@ -234,8 +234,8 @@ func NewProcessor( processor.application = application.New(state, converter) processor.conversations = conversations.New(state, converter, visFilter, muteFilter) processor.fedi = fedi.New(state, &common, converter, federator, visFilter) - processor.filtersv1 = filtersv1.New(state, converter, filterCommon, &processor.stream) - processor.filtersv2 = filtersv2.New(state, converter, filterCommon, &processor.stream) + processor.filtersv1 = filtersv1.New(state, converter, filterCommon) + processor.filtersv2 = filtersv2.New(state, converter, filterCommon) processor.interactionRequests = interactionrequests.New(&common, state, converter) processor.list = list.New(state, converter) processor.markers = markers.New(state, converter) -- cgit v1.2.3