Skip to content
New issue

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

Buffered channels #89

Merged
merged 6 commits into from
May 15, 2020
Merged

Buffered channels #89

merged 6 commits into from
May 15, 2020

Conversation

joakimmoller
Copy link
Contributor

@joakimmoller joakimmoller commented May 15, 2020

Using buffered channels since I noticed that the go routings spends a lot of time waiting for synchronization between channels. The value 1000 is a educated guess since I know one picture is about ~2000 rac-records. Innosat channel seems to be the limiting channel.

@joakimmoller joakimmoller changed the title buffered-channels Buffered channels May 15, 2020
Copy link
Contributor

@local-minimum local-minimum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, is the size set based on experimenting / random / recommendation? I guess it will set the upper limit of memory usage that may be needed, any risk this might get too high?

@@ -9,13 +9,15 @@ import (
// ExtractFunction is the type of the ExtractData function
type ExtractFunction func(callback common.Callback, streamBatch ...StreamBatch)

const channelBufferSize int = 1000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit-picking here, but are re there any cache chunk related reasons to think that 1024 might be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, it looks better :)

@joakimmoller
Copy link
Contributor Author

@local-minimum: experimenting and guessing - yes, the application will use more heap - we're useing about 120Mb on my laptop (8cpus)

@joakimmoller
Copy link
Contributor Author

joakimmoller commented May 15, 2020

Sorry guys I added one more optimization moved the image conversion into the go routine for encoding png.

Copy link
Contributor

@local-minimum local-minimum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please undo these extra changes. They will directly conflict with my PR and the optimization here seems much lower priority to me.

@joakimmoller joakimmoller merged commit a5b9a7d into master May 15, 2020
@joakimmoller joakimmoller deleted the buffered-channels branch May 15, 2020 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants