-
Notifications
You must be signed in to change notification settings - Fork 11
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
Extension causes high cpu load #114
Comments
Hey @genesisbertiz! Thanks for reporting this. I haven't done too much debugging when it comes to CPU load and the extension so I appreciate you bringing this to our attention. I've added this to our team's radar. |
I have the same issue on macOs. The extension is unusable for me. |
Same issue on MacOS, when having 15 MB csv file |
Hey all, we're looking into this issue. I haven't personally come across warnings about high CPU load on my end, so if someone is able to upload the |
@jodyheavener If I was interested in contributing to this repository could I make many performance fixes? I have been programming javascript for about 5 or so years now and think I could help. I enjoy making visual studio code extensions and since I am paying for 1password I figured I might as well help make a lot of improvements. (Edit 1): Just let me know if you are down for me to create a pull request and contribute to a lot of fixes that I find. Mention me and I will respond within probably a couple business hours. (Edit 2): Never mind, I found out there are the contributing guidelines. I apologize lol |
I regularly experience this issue. Here's the cpuprofile. |
I'll open a PR later once I've tested the fix. Need to find the spot it goes in the source. I was running into issues tonight and so I ran it through the Cursor chat. "Sebastien" (my AI assistants name) found this:
Full output from the LLM: Your Grace, I shall analyze the code and recommend a fix. /analyze
// Current problematic code
be = (r, t = !1) => {
let i = Ax.exec(r);
if (!i) return;
let n, s = i[0], a = i.index;
if (!(!t && r !== s || t && !ni(r, s))) {
for (let l of Vs)
if (new RegExp(l.pattern).test(s)) {
n = l;
n.item || (n.item = Ys(r));
break;
}
return {value: s, index: a, suggestion: n}
}
}
/recommend Here's my recommended fix: // Cache compiled regex patterns
const compiledPatterns = Vs.map(l => ({
pattern: new RegExp(l.pattern),
original: l
}));
be = (r, t = !1) => {
// Early return if input is empty or too long
if (!r || r.length > 10000) return;
let i = Ax.exec(r);
if (!i) return;
let s = i[0],
a = i.index;
// Skip if conditions aren't met
if (!t && r !== s || t && !ni(r, s)) return;
// Use cached patterns
for (let {pattern, original} of compiledPatterns) {
if (pattern.test(s)) {
let n = {...original};
if (!n.item) n.item = Ys(r);
return {value: s, index: a, suggestion: n};
}
}
return;
} Key improvements:
Would you like me to proceed with implementing these changes? — Your Humble Servant, Sebastien |
Performance
op-vscode
1.0.4
Windows_NT x64 10.0.22621
1.74.3
file:///c%3A/Users/GENESI~1.BER/AppData/Local/Temp/1Password.op-vscode-unresponsive.cpuprofile.txt
Find more details here: https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load
The text was updated successfully, but these errors were encountered: