mirror of
https://github.com/php/frankenphp.git
synced 2026-03-24 00:52:11 +01:00
perf: reduce allocs when creating $_SERVER (#540)
* perf: reduce allocs when creating $_SERVER * improve * refactor: prevent C allocs when populating $_SERVER * cs * remove append() * simplify * wip * cleanup * add cache * cleanup otter init * some fixes * cleanup * test with a leak * remove const? * add const * wip * wip * allocate dynamic variables in Go memory * cleanup * typo * bump otter * chore: bump deps
This commit is contained in:
@@ -18,7 +18,7 @@ func TestWorker(t *testing.T) {
|
||||
runTest(t, func(handler func(http.ResponseWriter, *http.Request), _ *httptest.Server, i int) {
|
||||
formData := url.Values{"baz": {"bat"}}
|
||||
req := httptest.NewRequest("POST", "http://example.com/worker.php?foo=bar", strings.NewReader(formData.Encode()))
|
||||
req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
req.Header.Set("Content-Type", strings.Clone("application/x-www-form-urlencoded"))
|
||||
w := httptest.NewRecorder()
|
||||
handler(w, req)
|
||||
|
||||
@@ -29,7 +29,7 @@ func TestWorker(t *testing.T) {
|
||||
|
||||
formData2 := url.Values{"baz2": {"bat2"}}
|
||||
req2 := httptest.NewRequest("POST", "http://example.com/worker.php?foo2=bar2", strings.NewReader(formData2.Encode()))
|
||||
req2.Header.Set("Content-Type", "application/x-www-form-urlencoded")
|
||||
req2.Header.Set("Content-Type", strings.Clone("application/x-www-form-urlencoded"))
|
||||
|
||||
w2 := httptest.NewRecorder()
|
||||
handler(w2, req2)
|
||||
|
||||
Reference in New Issue
Block a user