alibaba / alibaba/Sentinel

Suggestions about algorithm optimization for function "insertSorted" in InitExecutor

Open
#2,036 1 comment 0 reactions 0 assignees View on GitHub
kind/discussion
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Issue Description

Type: *bug report* or *feature request*

### Describe what happened (or what feature you want)
![image](https://user-images.githubusercontent.com/16860171/108616828-24488100-744c-11eb-8dba-0bfd63ab0cb2.png)
The function **insertSorted** in **InitExecutor** use InsertSort Algorithm currently.
Personally, I think we can use **binary search** algorithm
or replace **List** with **PriorityQueue**.
What do you think?

### Describe what you expected to happen
Look forward to your reply.
Thanks!

### How to reproduce it (as minimally and precisely as possible)

NONE

### Tell us your environment
NONE

### Anything else we need to know?

NONE

Contributor guide

Open the contributing guide

Research direction

Start by reading InitExecutor and locating the insertSorted function to understand its current insertion-sort behavior and how the List is used. Compare the proposed binary-search or PriorityQueue alternatives, but note that the issue provides no reproduction, benchmark, test, or acceptance criteria; a maintainer decision would be needed before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.