From 48513ca384ad8ef7d1b91d706cae462169ba04a6 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 23:48:57 +0000 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=20Bolt:=20Optimize=20keyword=20densit?= =?UTF-8?q?y=20tech=5Fkeywords=20lookup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move `tech_keywords` from a local list to a module-level set `_TECH_KEYWORDS`. - Reduces instantiation overhead and improves lookup time to $O(1)$ during keyword section suggestions. Co-authored-by: anchapin <6326294+anchapin@users.noreply.github.com> --- cli/utils/keyword_density.py | 80 ++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/cli/utils/keyword_density.py b/cli/utils/keyword_density.py index 7a0df7b..8d126cc 100644 --- a/cli/utils/keyword_density.py +++ b/cli/utils/keyword_density.py @@ -37,6 +37,45 @@ console = Console() +_TECH_KEYWORDS = { + "python", + "javascript", + "typescript", + "react", + "vue", + "angular", + "node.js", + "django", + "flask", + "fastapi", + "kubernetes", + "docker", + "aws", + "gcp", + "azure", + "sql", + "mongodb", + "postgresql", + "redis", + "ci/cd", + "devops", + "machine learning", + "ai", + "llm", + "pytorch", + "tensorflow", + "graphql", + "rest api", + "microservices", + "java", + "go", + "rust", + "c++", + "c#", + ".net", + "spring", +} + @dataclass class KeywordInfo: @@ -398,46 +437,7 @@ def _suggest_sections_for_keyword( suggestions = [] # Check if keyword is tech-related - tech_keywords = [ - "python", - "javascript", - "typescript", - "react", - "vue", - "angular", - "node.js", - "django", - "flask", - "fastapi", - "kubernetes", - "docker", - "aws", - "gcp", - "azure", - "sql", - "mongodb", - "postgresql", - "redis", - "ci/cd", - "devops", - "machine learning", - "ai", - "llm", - "pytorch", - "tensorflow", - "graphql", - "rest api", - "microservices", - "java", - "go", - "rust", - "c++", - "c#", - ".net", - "spring", - ] - - if keyword.lower() in tech_keywords: + if keyword.lower() in _TECH_KEYWORDS: suggestions.append("Skills section") # Check experience bullets