1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-11 10:07:54 -05:00

perf(ext/flash): remove string->buffer cache (#15850)

This commit is contained in:
Divy Srivastava 2022-09-10 21:53:00 +05:30 committed by cjihrig
parent e3090f11f3
commit 6abf70f10e
No known key found for this signature in database
GPG key ID: 7434390BDBE9B9C5

View file

@ -111,7 +111,6 @@
let dateInterval;
let date;
let stringResources = {};
// Construct an HTTP response message.
// All HTTP/1.1 messages consist of a start-line followed by a sequence
@ -209,18 +208,12 @@
nwritten = respondFast(requestId, response, end);
} else {
// string
const maybeResponse = stringResources[response];
if (maybeResponse === undefined) {
stringResources[response] = core.encode(response);
nwritten = core.ops.op_flash_respond(
server,
requestId,
stringResources[response],
end,
);
} else {
nwritten = respondFast(requestId, maybeResponse, end);
}
nwritten = core.ops.op_flash_respond(
server,
requestId,
response,
end,
);
}
if (nwritten < responseLen) {
@ -578,7 +571,6 @@
date = new Date().toUTCString();
dateInterval = setInterval(() => {
date = new Date().toUTCString();
stringResources = {};
}, 1000);
}