-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Long running encodedSemanticClassifications-full request with @discordjs/voice #49053
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
Comments
Does this reproduce in the latest VS Code insiders build with all extensions disabled? |
Yes, I am able to reproduce it in the latest insiders build as well. |
This is the exact piece of code that makes it lag. However having only one this.voice_connection.on(VoiceConnectionStatus.Disconnected, (old_state, new_state)=>{
if(this.state=="PLAYING"){
this.pause();
}
});
this.voice_connection.on(VoiceConnectionStatus.Ready, (new_state, old_state)=>{
if(this.state=="PAUSED"){
this.resume();
}
});
this.voice_connection.on(VoiceConnectionStatus.Connecting, (old_state, new_state)=>{
if(this.state=="PLAYING"){
this.pause();
}
});
this.voice_connection.on(VoiceConnectionStatus.Signalling, (old_state, new_state)=>{
if(this.state=="PLAYING"){
this.pause();
}
});
this.voice_connection.on(VoiceConnectionStatus.Destroyed, (old_state, new_state)=>{
if(this.state=="PLAYING" || this.state=="PAUSED"){
this.stop();
}
}); EDIT: The lag stops if there are 0 or 1 arguments in the handler. |
Can you please share a small, self contained project that demonstrates the issue? |
I could not really find out why it happens with this library, but here is an example of the problem: https://github.com/Laci0503/vscode-lag-issue-test-project.git |
Thanks @Laci0503 With the project, I see
Moving for TS for investigation |
Thanks for your help. |
Issue Type: Performance Issue
JavaScript autocomplete becomes very slow and uses a lot of cpu.
Steps to reproduce:
I am using the Discord.JS library, and the VoiceConnection object uses events which are not named with strings but objects.
For example:
(method) TypedEmitter.on<VoiceConnectionStatus.Disconnected>(event: VoiceConnectionStatus.Disconnected, listener: (oldState: VoiceConnectionState, newState: (VoiceConnectionDisconnectedOtherState & {
...;
}) | (VoiceConnectionDisconnectedWebSocketState & {
...;
})) => Awaited<...>): VoiceConnection
It seems to me that if I bind an event to this emitter, the autocomplete becomes slow.
Example:
this.voice_connection.on(VoiceConnectionStatus.Disconnected, (old_state, new_state)=>{
if(this.state=="PLAYING"){
this.pause();
}
});
However if I comment this out it stops lagging.
I reproduced this with extensions disabled.
VS Code version: Code 1.66.2 (dfd34e8260c270da74b5c2d86d61aee4b6d56977, 2022-04-11T07:46:01.075Z)
OS version: Windows_NT x64 10.0.19043
Restricted Mode: No
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Process Info
Workspace Info
A/B Experiments
The text was updated successfully, but these errors were encountered: