feat: do not use open servers unless explicitly specified#96
Open
feat: do not use open servers unless explicitly specified#96
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modifies the server selection logic to exclude "open" servers by default, filtering to only use servers that start with "node" unless explicitly specified via the server_list parameter. This change is motivated by performance concerns, as noted in the comment that open servers are too slow.
Changes:
- Modified server selection logic to filter out "open" servers by default when
server_listis "all" or empty - Added explanatory comment about why open servers are excluded
- Applied filtering using lambda function to check server names starting with "node"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
perf_trigger/main.py
Outdated
Comment on lines
162
to
164
| serer_pool = list(filter(lambda s: s.startswith("node"), SERVER_POOL)) | ||
| desired_sever_num = min(len(self.checkpoints) // 64 + 1, len(serer_pool)) | ||
| server_pool = random.sample(serer_pool, k=desired_sever_num) |
There was a problem hiding this comment.
Typo in variable name: 'serer_pool' should be 'server_pool'. The word 'server' is misspelled as 'serer'. Although the code is internally consistent (using 'serer_pool' on lines 162-164), this typo makes the code harder to read and maintain.
Suggested change
| serer_pool = list(filter(lambda s: s.startswith("node"), SERVER_POOL)) | |
| desired_sever_num = min(len(self.checkpoints) // 64 + 1, len(serer_pool)) | |
| server_pool = random.sample(serer_pool, k=desired_sever_num) | |
| server_pool = list(filter(lambda s: s.startswith("node"), SERVER_POOL)) | |
| desired_sever_num = min(len(self.checkpoints) // 64 + 1, len(server_pool)) | |
| server_pool = random.sample(server_pool, k=desired_sever_num) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
No description provided.