Dart performance: best approach for thousands of low-level IO operations

Viewed 151

I have a Dart performance design/architecture question, which I realize may not have a clear-cut answer.

I'm working on a Git implementation in Dart, that needs to be fast (low latency, high throughput), as I'm going to use it to query Git Packs with hundreds of thousands of records (Pack = internal git file that stores files as deltas of other files, and zlib-compressed).

  • Most of the IO load will be thousands of small read operations across one or more of these pack files.

  • CPU load will consist of decompressing the data, and concatenating small chunks into larger UInt8Lists (still mostly less than 1KByte)

  • Some of these operations may be parallellizable (decompression, processing of unrelated objects). Some processing could happen while waiting for IO.

My dilemma is as follows.. Should I implement "everything" (including all low level IO operations, and cpu limited operations) with async/await? Will this give me a performance boost or make it easier to parallelize things in the future? Or will there be a significant overhead cost, and should I rather make most low-level operations Synchronous, and parallelize on a high level with Isolates where possible?

I noticed as many people point out that 'async' is contagious, and slowly all my functions now have 'async' in the name, so it will be costly to make everything sync again later. Thats why I want to make an informed decision at this point.

Any thoughts?

0 Answers
Related