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

simplify coprocessor goroutines to reduce latency in ad-hoc like queries #53250

Open
you06 opened this issue May 14, 2024 · 0 comments · May be fixed by #53251
Open

simplify coprocessor goroutines to reduce latency in ad-hoc like queries #53250

you06 opened this issue May 14, 2024 · 0 comments · May be fixed by #53251

Comments

@you06
Copy link
Contributor

you06 commented May 14, 2024

Enhancement

Now the coprocessor works with 3 types of goroutines.

                  ┌────────┐                  
                  │        │                  
             ┌───►│ worker ├───┐              
             │    │        │   │              
             │    └────────┘   │              
             │                 │              
             │    ┌────────┐   │              
             │    │        │   │              
             ├───►│ worker ├───┤              
             │    │        │   │              
             │    └────────┘   │              
             │                 │              
┌────────┐   │    ┌────────┐   │    ┌────────┐
│        │   │    │        │   │    │        │
│ sender ├───┼───►│ worker ├───┼───►│  Next  │
│        │   │    │        │   │    │        │
└────────┘   │    └────────┘   │    └────────┘
             │                 │              
             │    ┌────────┐   │              
             │    │        │   │              
             ├───►│ worker ├───┤              
             │    │        │   │              
             │    └────────┘   │              
             │                 │              
             │    ┌────────┐   │              
             │    │        │   │              
             └───►│ worker ├───┘              
                  │        │                  
                  └────────┘                  

When the number of tasks is low, the sender is not required, and it can just be:

┌────────┐                  
│        │                  
│ worker ├───┐              
│        │   │              
└────────┘   │              
             │              
┌────────┐   │              
│        │   │              
│ worker ├───┤              
│        │   │              
└────────┘   │              
             │              
┌────────┐   │    ┌────────┐
│        │   │    │        │
│ worker ├───┼───►│  Next  │
│        │   │    │        │
└────────┘   │    └────────┘
             │              
┌────────┐   │              
│        │   │              
│ worker ├───┤              
│        │   │              
└────────┘   │              
             │              
┌────────┐   │              
│        │   │              
│ worker ├───┘              
│        │                  
└────────┘                  

This can erase the sender goroutine and the channel between sender and workers.

@you06 you06 linked a pull request May 14, 2024 that will close this issue
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant