We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi, I have a workflow like dsl-interpreter from sample and I found that my workflow is slow.
For some reason using async functions in workflows is drastically slower than sync functions. Could you help me?
I have 2 identical workflows (synthetic examples), the difference only in using async in functions:
// sync workflow async function run() { const iters = () => 0; const condition = (iters) => iters < 10_000; const incr = (iters) => iters + 1; const out = (iters) => iters; let i = iters(); while (condition(i)) { i = incr(i); } return out(i); } // async workflow async function run() { const iters = async () => 0; const condition = (iters) => iters < 10_000; const incr = async (iters) => iters + 1; const out = async (iters) => iters; let i = await iters(); while (condition(i)) { i = await incr(i); } return await out(i); }
My worker and client
// worker.js const path = require('path'); const { Worker } = require('@temporalio/worker'); async function main() { const worker = await Worker.create({ workflowsPath: path.join(__dirname, './workflows.js'), taskQueue: 'hello-javascript', }); await worker.run(); } main().catch((err) => { console.error(err); process.exit(1); }); // client.js const { Client, Connection } = require('@temporalio/client'); const { run } = require('./workflows'); async function main() { const connection = await Connection.connect({}); const client = new Client({ connection, }); console.time('client'); // start timer const result = await client.workflow.execute(run, { taskQueue: 'hello-javascript', workflowId: 'my-business-id', args: ['Temporal'], }); console.timeEnd('client'); // end timer console.log(result); } main().catch((err) => { console.error(err); process.exit(1); });
And I have this results
temporal -v temporal version 1.0.0 (Server 1.24.2, UI 2.28.0)
SDK: typescript-sdk: 1.10.3
Are you using Docker or Kubernetes or building Temporal from source? I installed temporal from brew
The text was updated successfully, but these errors were encountered:
No branches or pull requests
What are you really trying to do?
Hi, I have a workflow like dsl-interpreter from sample and I found that my workflow is slow.
Describe the bug
For some reason using async functions in workflows is drastically slower than sync functions. Could you help me?
I have 2 identical workflows (synthetic examples), the difference only in using async in functions:
My worker and client
And I have this results
Environment/Versions
SDK: typescript-sdk: 1.10.3
Are you using Docker or Kubernetes or building Temporal from source?
I installed temporal from brew
The text was updated successfully, but these errors were encountered: