From d1a3f98df9f3e6cd3e058948033dc5abe88170a4 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 29 Jun 2025 19:48:26 +0200 Subject: [PATCH] perf(fetcher): save 8 bytes in the RequestBuilder struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit before: ``` // request_builder.go:25 | Size: 64 (Optimal: 56) type RequestBuilder struct { headers http.Header ■ ■ ■ ■ ■ ■ ■ ■ clientProxyURL *url.URL ■ ■ ■ ■ ■ ■ ■ ■ useClientProxy bool ■ □ □ □ □ □ □ □ clientTimeout int ■ ■ ■ ■ ■ ■ ■ ■ withoutRedirects bool ■ ignoreTLSErrors bool ■ disableHTTP2 bool ■ □ □ □ □ □ proxyRotator *proxyrotator.ProxyRotator ■ ■ ■ ■ ■ ■ ■ ■ feedProxyURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ } ``` after: ``` // request_builder.go:25 | Size: 56 type RequestBuilder struct { headers http.Header ■ ■ ■ ■ ■ ■ ■ ■ clientProxyURL *url.URL ■ ■ ■ ■ ■ ■ ■ ■ clientTimeout int ■ ■ ■ ■ ■ ■ ■ ■ useClientProxy bool ■ withoutRedirects bool ■ ignoreTLSErrors bool ■ disableHTTP2 bool ■ □ □ □ □ proxyRotator *proxyrotator.ProxyRotator ■ ■ ■ ■ ■ ■ ■ ■ feedProxyURL string ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ ■ } ``` --- internal/reader/fetcher/request_builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/reader/fetcher/request_builder.go b/internal/reader/fetcher/request_builder.go index 71ee4b4e..c93c460b 100644 --- a/internal/reader/fetcher/request_builder.go +++ b/internal/reader/fetcher/request_builder.go @@ -25,8 +25,8 @@ const ( type RequestBuilder struct { headers http.Header clientProxyURL *url.URL - useClientProxy bool clientTimeout int + useClientProxy bool withoutRedirects bool ignoreTLSErrors bool disableHTTP2 bool