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