[Perf]Optimize waiting queue update with set usage#20503
Merged
Kangyan-Zhou merged 3 commits intosgl-project:mainfrom Mar 18, 2026
Merged
[Perf]Optimize waiting queue update with set usage#20503Kangyan-Zhou merged 3 commits intosgl-project:mainfrom
Kangyan-Zhou merged 3 commits intosgl-project:mainfrom
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Wangzheee
pushed a commit
to Wangzheee/sglang
that referenced
this pull request
Mar 21, 2026
0-693
pushed a commit
to 0-693/sglang
that referenced
this pull request
Mar 25, 2026
dutsc
pushed a commit
to dutsc/sglang
that referenced
this pull request
Mar 30, 2026
JustinTong0323
pushed a commit
to JustinTong0323/sglang
that referenced
this pull request
Apr 7, 2026
yhyang201
pushed a commit
to yhyang201/sglang
that referenced
this pull request
Apr 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Modifications
By moving from recreating the set on every iteration to creating it just once and reusing it subsequently, and assuming waiting_queue has length n and can_run_list has length m, the time complexity decreases from O(n × m) to O(n + m).
Accuracy Tests
gsm8k:
Accuracy: 0.952 Invalid: 0.000 Latency: 68.010s Output throughput: 1209.593 token/sBenchmarking and Profiling
device: H200*2
Models: Qwen3-Next-80B-A3B-FP8
num-prompt:500 random-input-len: 1K random-output-len:1K
Org: Req throughput: 7.57 req/s Mean TTFT: 3229.88ms Mean ITL: 84.52ms
Opt: Req throughput: 7.64 req/s Mean TTFT: 2844.76ms Mean ITL: 83.98ms
TTFT decreased by 11.9%
Checklist