ClickHouse / ClickHouse/clickhouse-js

Add support for running the result parser in a Web/NodeJS worker

Open
#529 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
331
Forks
74
PR merge metrics
No merged PRs in 30d

Description

### Use case

For bigger chunks it might take some significant amount of time to parse ClickHouse chunks and then parse the corresponding JSON into JS objects which leads to the event loop lag growing or even to some events timing out because of the micro-tasks.

### Describe the solution you'd like

Allows the networking and chunking code to run in a separate thread passing back only the already parsed JS objects using [structured clone](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm) mechanism. Even though this requires additional CPU cycles and memory copying the benefit of using multiple CPU cores and a separate event loop might be desirable for high load applications reading multiple heavy streams in the same JS isolate.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.