cognitect / cognitect/transit-java

flush behavior during packing

Open
#33 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
65
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Two issues popped up in transit-clj which are better recorded here:

  • cognitect/transit-clj#43
  • cognitect/transit-clj#46

In essence:
https://github.com/cognitect/transit-java/blob/cff7111c2081fc8415cd9bd6c6b2ba518680d660/src/main/java/com/cognitect/transit/impl/AbstractEmitter.java#L189

The flushwriter flushes down the data from the output channel after serializing every single element of a data structure, causing a performance drop because the process will need to wait until the operating system forced every single newly serialized bit of data out onto the disk (or in the example of other streams, fragment it somehow on the network level).

I don't think the flush there is necessary but should move only to the end of the whole serialization process in write.

I would be happy to help or provide patches, just let me know. Thanks! :)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/main/java/com/cognitect/transit/impl/AbstractEmitter.java at the referenced line and trace how write serializes a complete data structure. Confirm where FlushWriter currently flushes during element serialization and where write completes. Done means flushing is deferred until the whole serialization process ends, without changing the serialized output.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, performance
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.