Comments (2)
Hello @RonLinu This is interesting. I checked CPU resource using top command while I connect Scratch on FireFox and my micro:bit via pyscrlink.
top - 15:09:54 up 20 min, 3 users, load average: 2.00, 1.08, 0.56
Tasks: 194 total, 1 running, 193 sleeping, 0 stopped, 0 zombie
%Cpu(s): 27.6 us, 1.6 sy, 0.0 ni, 68.3 id, 1.9 wa, 0.4 hi, 0.1 si, 0.0 st
MiB Mem : 7814.2 total, 3160.1 free, 3355.6 used, 2315.4 buff/cache
MiB Swap: 8192.0 total, 8192.0 free, 0.0 used. 4458.6 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1452 shin 20 0 3090440 380024 132180 S 76.6 4.7 1:14.33 Isolated Web Co
1233 shin 20 0 12.3g 840500 359876 S 22.6 10.5 2:21.33 firefox
2128 shin 20 0 192372 34316 14364 S 13.1 0.4 0:39.27 python
I see the process "Isolated Web Co" uses high CPU resource. Is this same as your environment? According to ps command, this process is part of firefox. The 2nd highest CPU resource eater is another firefox process. And the 3rd process is python, which runs pyscrlink.
I measured CPU usage with Chromium instead of Firefox.
Tasks: 217 total, 1 running, 216 sleeping, 0 stopped, 0 zombie
%Cpu(s): 26.3 us, 1.5 sy, 0.0 ni, 71.2 id, 0.2 wa, 0.8 hi, 0.1 si, 0.0 st
MiB Mem : 7814.2 total, 2300.1 free, 3752.5 used, 3135.2 buff/cache
MiB Swap: 8192.0 total, 8192.0 free, 0.0 used. 4061.7 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
3260 shin 20 0 1137.2g 339040 142140 S 81.1 4.2 0:44.34 chromium
2901 shin 20 0 266380 36544 14380 S 18.3 0.5 1:26.18 python
Result is similar. Chromium consumes high CPU usage.
So, it looks the CPU resource is consumed on browser processes, not by pyscrlink. I'm not sure what can be done by pyscrlink to reduce the CPU usage.
from pyscrlink.
Yes, Chromium or Firefox can take non-neligeable ressources but when I look in my System Monitor window, I see a specific entry for 'scratch_link'.
I took two screenshots (coudn't figure out yet how to just copy/paste the text ):
This first screenshot is during a connection to a running Scratch program:
This second screenshot is after I terminated the Scratch program. This is where it goes a bit crazy. My computer fan starts to spin fast, this is how I found out about this behavior.
I somewhat fixed this with two scripts: one that starts 'scracth_link' and a second one that kills it when I don't need it.
But from what you said, maybe 'scratch_link' is not directly ressource hungry and, instead, inadvertently affect another process once a Scratch program is terminated.
Ron
from pyscrlink.
Related Issues (20)
- Avoid sudo for scratcy_link.py HOT 7
- Multiple users support HOT 3
- Lego WeDo Support HOT 3
- Delay between sending command from Scratch and forwarding to the device HOT 3
- bluetooth connection to lego boost HOT 16
- Try to connect to LEGO HUB HOT 16
- Bluetooh connection Raspberry Pi 4 with Lego WeDo 2.0 HOT 13
- Second device disconnected HOT 10
- scratch_link procudes endless loop HOT 6
- BLE session disconnected with toio on playmat HOT 3
- Issue during device scanning HOT 5
- failed to connect with latest master HOT 8
- Support for Intelino Smart Train HOT 21
- Unicode decode error HOT 1
- BUG Method always returns None and awaits a miracle? ;) HOT 3
- LEGO boost HOT 8
- ERROR:ssl_client_socket_impl.cc handshake failed on Ubuntu 22.04 HOT 10
- PR_END_OF_FILE_ERROR - Secure Connection Failed HOT 6
- Lego WeDo: Unable to reestablish connection HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyscrlink.