When authentication is requested, currently a new CurlRequest is generated. For a sake of CPU and memory cost, it's better to reuse the same instance by implementing reset method.
Created attachment 331437 [details] Patch
Comment on attachment 331437 [details] Patch This kind of pattern adds a lot of places where if we add something new we will forget to update all the different ways of resetting it. Can you measure a significant performance improvement?
> This kind of pattern adds a lot of places where if we add something new we will forget to update all the different ways of resetting it. Can you measure a significant performance improvement? I agree with that concern, but beside those costs, we have an intention to reuse the request object for redirecting with following patch because some information are need to pass to the next communication. Without reset, we need to create a new instance and set those information. So that means we also have a risk if we forget to set those mandatery info . Thinking about the future safety, how about this: - we initialize values just before start communication even for the first communication. All initialization goes there. - those info we need to maintain among series of request are safe to be there.
What does this improve?
We are discussing about the cost we can save with this patch. As you suggested if the cost gain is small, we will close this bug. The result will be in next week.
This bug was obsoleted with a new plan. https://bugs.webkit.org/show_bug.cgi?id=183010