From 112494bb6610f4e67749b2c0be609dd0a32004b7 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 29 Jun 2025 19:45:33 +0200 Subject: [PATCH] perf(feed): save 16 bytes in the Feed struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit before: ``` // feed.go:25 | Size: 560 (Optimal: 544) type Feed struct { ID int64 ■ ■ ■ ■ ■ ■ ■ ■ UserID int64 ■ ■ ■ ■ ■ ■ ■ ■ FeedURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ SiteURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Title string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Description string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ CheckedAt time.Time ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ NextCheckAt time.Time ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ EtagHeader string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ LastModifiedHeader string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ParsingErrorMsg string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ParsingErrorCount int ■ ■ ■ ■ ■ ■ ■ ■ ScraperRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ RewriteRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Crawler bool ■ □ □ □ □ □ □ □ BlocklistRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ KeeplistRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ BlockFilterEntryRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ KeepFilterEntryRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ UrlRewriteRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ UserAgent string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Cookie string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Username string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Password string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Disabled bool ■ NoMediaPlayer bool ■ IgnoreHTTPCache bool ■ AllowSelfSignedCertificates bool ■ FetchViaProxy bool ■ HideGlobally bool ■ DisableHTTP2 bool ■ □ AppriseServiceURLs string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ WebhookURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ NtfyEnabled bool ■ □ □ □ □ □ □ □ NtfyPriority int ■ ■ ■ ■ ■ ■ ■ ■ NtfyTopic string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ PushoverEnabled bool ■ □ □ □ □ □ □ □ PushoverPriority int ■ ■ ■ ■ ■ ■ ■ ■ ProxyURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Category *Category ■ ■ ■ ■ ■ ■ ■ ■ Icon *FeedIcon ■ ■ ■ ■ ■ ■ ■ ■ Entries Entries ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ TTL int ■ ■ ■ ■ ■ ■ ■ ■ IconURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ UnreadCount int ■ ■ ■ ■ ■ ■ ■ ■ ReadCount int ■ ■ ■ ■ ■ ■ ■ ■ NumberOfVisibleEntries int ■ ■ ■ ■ ■ ■ ■ ■ } ``` after: ``` // feed.go:25 | Size: 544 type Feed struct { ID int64 ■ ■ ■ ■ ■ ■ ■ ■ UserID int64 ■ ■ ■ ■ ■ ■ ■ ■ FeedURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ SiteURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Title string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Description string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ CheckedAt time.Time ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ NextCheckAt time.Time ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ EtagHeader string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ LastModifiedHeader string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ParsingErrorMsg string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ParsingErrorCount int ■ ■ ■ ■ ■ ■ ■ ■ ScraperRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ RewriteRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ BlocklistRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ KeeplistRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ BlockFilterEntryRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ KeepFilterEntryRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ UrlRewriteRules string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ UserAgent string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Cookie string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Username string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Password string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Disabled bool ■ NoMediaPlayer bool ■ IgnoreHTTPCache bool ■ AllowSelfSignedCertificates bool ■ FetchViaProxy bool ■ HideGlobally bool ■ DisableHTTP2 bool ■ PushoverEnabled bool ■ NtfyEnabled bool ■ Crawler bool ■ □ □ □ □ □ □ AppriseServiceURLs string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ WebhookURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ NtfyPriority int ■ ■ ■ ■ ■ ■ ■ ■ NtfyTopic string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ PushoverPriority int ■ ■ ■ ■ ■ ■ ■ ■ ProxyURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ Category *Category ■ ■ ■ ■ ■ ■ ■ ■ Icon *FeedIcon ■ ■ ■ ■ ■ ■ ■ ■ Entries Entries ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ TTL int ■ ■ ■ ■ ■ ■ ■ ■ IconURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ UnreadCount int ■ ■ ■ ■ ■ ■ ■ ■ ReadCount int ■ ■ ■ ■ ■ ■ ■ ■ NumberOfVisibleEntries int ■ ■ ■ ■ ■ ■ ■ ■ } ``` --- internal/model/feed.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/model/feed.go b/internal/model/feed.go index c9713a22..a25ebbe5 100644 --- a/internal/model/feed.go +++ b/internal/model/feed.go @@ -37,7 +37,6 @@ type Feed struct { ParsingErrorCount int `json:"parsing_error_count"` ScraperRules string `json:"scraper_rules"` RewriteRules string `json:"rewrite_rules"` - Crawler bool `json:"crawler"` BlocklistRules string `json:"blocklist_rules"` KeeplistRules string `json:"keeplist_rules"` BlockFilterEntryRules string `json:"block_filter_entry_rules"` @@ -54,12 +53,13 @@ type Feed struct { FetchViaProxy bool `json:"fetch_via_proxy"` HideGlobally bool `json:"hide_globally"` DisableHTTP2 bool `json:"disable_http2"` + PushoverEnabled bool `json:"pushover_enabled"` + NtfyEnabled bool `json:"ntfy_enabled"` + Crawler bool `json:"crawler"` AppriseServiceURLs string `json:"apprise_service_urls"` WebhookURL string `json:"webhook_url"` - NtfyEnabled bool `json:"ntfy_enabled"` NtfyPriority int `json:"ntfy_priority"` NtfyTopic string `json:"ntfy_topic"` - PushoverEnabled bool `json:"pushover_enabled"` PushoverPriority int `json:"pushover_priority"` ProxyURL string `json:"proxy_url"`