mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
katex: Replace subprocess call with minimal external service.
Replace a separate call to subprocess, starting `node` from scratch, with an optional standalone node Express service which performs the rendering. In benchmarking, this reduces the overhead of a KaTeX call from 120ms to 2.8ms. This is notable because enough calls to KaTeX in a single message would previously time out the whole message rendering. The service is optional because he majority of deployments do not use enough LaTeX to merit the additional memory usage (60Mb). Fixes: #17425.
This commit is contained in:
committed by
Tim Abbott
parent
5fd38f15a6
commit
c13e3dee24
@@ -255,11 +255,18 @@ export default (
|
||||
name: "server",
|
||||
target: "node",
|
||||
entry: {
|
||||
katex_server: "babel-loader!./server/katex_server.ts",
|
||||
"katex-cli": "shebang-loader!katex/cli",
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(__dirname, "../static/webpack-bundles"),
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
// koa-body uses formidable 2.x, which suffers from https://github.com/node-formidable/formidable/issues/337
|
||||
hexoid: "hexoid/dist/index.js",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
return [frontendConfig, serverConfig];
|
||||
|
Reference in New Issue
Block a user