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:
parent
e3090f11f3
commit
6abf70f10e
1 changed files with 6 additions and 14 deletions
|
@ -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],
|
||||
response,
|
||||
end,
|
||||
);
|
||||
} else {
|
||||
nwritten = respondFast(requestId, maybeResponse, end);
|
||||
}
|
||||
}
|
||||
|
||||
if (nwritten < responseLen) {
|
||||
|
@ -578,7 +571,6 @@
|
|||
date = new Date().toUTCString();
|
||||
dateInterval = setInterval(() => {
|
||||
date = new Date().toUTCString();
|
||||
stringResources = {};
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue