bogdanfinn / tls-client

net/http.Client like HTTP Client with options to select specific client TLS Fingerprints to use for requests.
BSD 4-Clause "Original" or "Old" License
860 stars 164 forks source link

memory alignment #129

Closed ManuCiao10 closed 2 weeks ago

ManuCiao10 commented 3 months ago

Hi, We can rearrange the structure to save some memory. This optimization has been implemented on a darwin system.

tls-client/profiles/profiles.go:71:20: 8 bytes tls-client/client.go:45:17: 16 bytes tls-client/client_options.go:16:23: 56 bytes tls-client/client_options.go:39:23: 24 bytes tls-client/connect.go:77:20: 32 bytes tls-client/jar.go:15:22: 8 bytes tls-client/roundtripper.go:24:19: 16 bytes tls-client/cffi_src/types.go:34:31: 8 bytes tls-client/cffi_src/types.go:51:19: 16 bytes tls-client/cffi_src/types.go:90:22: 8 bytes tls-client/cffi_src/types.go:129:23: 56 bytes tls-client/cffi_src/types.go:148:20: 4 bytes tls-client/cffi_src/types.go:154:13: 8 bytes tls-client/cffi_src/types.go:185:15: 8 bytes tls-client/example/main.go:37:14: 8 bytes tls-client/example/main.go:39:16: 8 bytes tls-client/example/main.go:71:27: 24 bytes tls-client/tests/client_test_utils.go:12:14: 8 bytes tls-client/tests/client_test_utils.go:14:16: 8 bytes tls-client/tests/client_test_utils.go:46:27: 24 bytes