tag1consulting / goose

Load testing framework, inspired by Locust
https://tag1.com/goose
Apache License 2.0
737 stars 67 forks source link

make it possible to disable cookies and optimize startup #578

Open jeremyandrews opened 6 months ago

jeremyandrews commented 6 months ago

By making this a compile-time feature, we can enforce at compile-time that nobody expects cookies to work properly when using this startup optimization. Attempts to use Reqwest's cookie-related functions will fail if the Goose cookie feature is disabled. This also removes the cookie dependencies when it's not needed.

jeremyandrews commented 6 months ago

As far as I understand the slowdown is mostly from reqwest cookie feature itself, so removing that is fine, but cluttering the code with cfg feels like premature optimization.

Yes, the added config option is not an attempt to speed up or optimize anything. It's so the compiler can catch if someone 1) disables cookies, and then 2) tries to use cookie functinality: it will fail to compile. Without the config option, a person could disable cookies but use the code causing a panic or other undefined errors.