You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SSH远程调用进程运行位置及脚本执行耗时差异咨询

Why Remote SSH Execution is Faster Than Local on Raspberry Pi (With Print Statements)

Great question! Let’s start by resolving your core confusion: every process you trigger via SSH runs entirely on the Raspberry Pi server—your MacBook is just acting as a remote terminal to send commands and receive output. The surprising speed difference you’re seeing comes down to how terminal output is handled locally vs. remotely, not where the script executes.

Here’s a breakdown of what’s happening:

  • Local terminal rendering is a major bottleneck for Raspberry Pi
    When you run the script directly on your Pi (connected to a monitor via HDMI or using a local serial terminal), every print statement forces the Pi’s CPU and GPU to handle text rendering and screen refresh. The Raspberry Pi 3 has limited GPU resources, and constantly updating the screen with hundreds/thousands of lines of output eats up a significant chunk of system power that could otherwise go toward your arithmetic loop. This overhead is way heavier than you might expect.

  • Remote SSH offloads output handling to your MacBook
    When you run the script over SSH, the Pi only needs to send the print output over the network as raw text data to your MacBook. It doesn’t have to spend any cycles rendering characters to a local screen. Your MacBook’s terminal (which has far more powerful hardware for UI rendering) handles all the display work. Since the Pi can dedicate almost all its CPU to the arithmetic loop instead of screen updates, the script runs much faster.

  • The "no print" test confirms this theory
    When you remove the print statements, you eliminate the terminal output bottleneck entirely. Now both local and remote execution are just using the Pi’s CPU to run the arithmetic loop—no extra resources are spent on rendering or network transmission. That’s why the run times become nearly identical.

To put it simply: The Pi’s local terminal is slow at handling lots of output, and SSH lets you bypass that slowdown by shifting the display work to your more powerful MacBook.

内容的提问来源于stack exchange,提问作者Tripp Cannella

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 07:04:05