You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue #10243 still persists even in the latest version:
cat go.js
require("@swc-node/register");require("./test");
cat test.ts
classTest{a;b;c;d;e;f;g;h;i;j;k;l;m;n;o;p;q;r;s;t;u;v;w;x;y;z;constructor(){}hello(){return'HELLO';}}setTimeout(()=>{},20*1000);// to make the process run for 20 seconds
/usr/bin/time -v node go.js
Command being timed: "node go.js"
User time (seconds): 2.73
System time (seconds): 0.81
Percent of CPU this job got: 17%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:20.32
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 156620
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 15834
Voluntary context switches: 1125721
Involuntary context switches: 133
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
With 1.10.8:
/usr/bin/time -v node go.js
Command being timed: "node go.js"
User time (seconds): 0.33
System time (seconds): 0.07
Percent of CPU this job got: 2%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:20.32
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 131564
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 14030
Voluntary context switches: 175
Involuntary context switches: 17
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
As you can see, the process constantly uses 15% CPU (2.7s of CPU time in 20s) while in 1.10.8 it only uses 2% cpu (0.33s in 20s), all of which is during transpilation (0% during idle).
No swcrc file is present.
CPU usage seems to proportionally rise the more properties the class has.
Uh oh!
There was an error while loading. Please reload this page.
Describe the bug
The issue #10243 still persists even in the latest version:
cat go.js
cat test.ts
cat package.json
With 1.11.24:
With 1.10.8:
As you can see, the process constantly uses 15% CPU (2.7s of CPU time in 20s) while in 1.10.8 it only uses 2% cpu (0.33s in 20s), all of which is during transpilation (0% during idle).
No swcrc file is present.
CPU usage seems to proportionally rise the more properties the class has.
Link to the code that reproduces this issue
https://play.swc.rs/?version=1.11.24&code=H4sIAAAAAAAAAx3Pyw6CQAwF0P18RXeAMWF0S3Rn4oLEDT%2BAUAR5DM50fBH%2B3bluTtqk7U1VNZTOUcFOaFFEZRa4ggrUgEEDbqAFHbiDHgxgBBMwYAYPYIEDAjx4ghd4gw%2F4%2FnPN5MT6SoyNE1pWJPIwGDShDtdYvJ0oOp%2Fy%2FBJhZVWrUsqxFN3IxkscZg%2FHsLulvaYN7bTWSUZpSmJoLHsmaZlmayoOv1s%2FUWMsRh2H9Nr9AO8kjXIVAQAA&config=H4sIAAAAAAAAA1VQOw6DMAzdOQXy3LUdeocewkoNCiIf2Y5UhLh7E0Io3ez38bO9dn0Pkxh49msucxORhfjsMyKLV%2FxkBHSJJIZtVLg1VqVQyol2ZKsEKPJIWkwk90MNcwhCGRtwFmpCRi9DYFcigQmNXsM5ebWumACTBodqDdSkFuWst8NyNZngIpPIf1SRoh%2Fnc4M6pjuWBhfeaSePT5Rr6wEP%2BIla2DkYrLyac3%2FD9gW9JRc9VQEAAA%3D%3D
SWC Info output
Expected behavior
No CPU usage
Actual behavior
High CPU usage on idle (even after transpilation done)
Version
1.11.24
Additional context
No response
The text was updated successfully, but these errors were encountered: