planck-repl / planck

Stand-alone ClojureScript REPL
https://planck-repl.org
Eclipse Public License 1.0
1.03k stars 68 forks source link

Slow REPL on Raspberry Pi 3 Model B #537

Open pwhittin opened 7 years ago

pwhittin commented 7 years ago

I just cloned planck version:

commit 8504dfa07d4e19b098ff061ef1d05373d866848c
Author: Mike Fikes <mike@fikesfarm.com>
Date:   Thu Sep 7 12:16:05 2017 -0400

and built planck for a Raspberry Pi 3 Model B.

  1. When I run "planck" it terminates with a Segmentation Fault.

  2. When I run "planck -c $(pwd)" it loads up, and gives me the prompt. Then when I run "(+ 1 2)" at the prompt it takes a LOOOONG time to come back with the correct answer.

  3. When I run "planck -c $(pwd) -e '(+ 1 2)'" it runs in 2.3 seconds and returns the right answer.

Any thoughts?

Build Process

  1. Followed planck project instructions, and successfully built on Ubuntu 16.04.
  2. Copied planck source tree from step (1) to Raspbery Pi
  3. Within the "planck/planck-c/build" directory executed "make clean" and "make" to create planck.

Raspbery Pi Environment

"Raspbian Stretch With Desktop" downloaded from https://www.raspberrypi.org/downloads/raspbian/ version:

RASPBIAN STRETCH WITH DESKTOP
Image with desktop based on Debian Stretch
Version:August 2017
Release date:2017-08-16
Kernel version:4.9

pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux

pi@raspberrypi:~ $ cat /etc/os-release 
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
mfikes commented 7 years ago

Hi @pwhittin, here are a couple of ideas.

In your step 3, you are essentially using the Makefile that was produced on your Ubuntu 16.04 box, which may be causing it to build against libraries that might be slightly different on your Raspberry Pi. You could eliminate this as a concern by going into planck/planck-c/build, removing everything from there (using rm -rf *), and then running CMake again as cmake ... This will cause CMake to generate a new Makefile, and then you can then run make.

The second idea is that perhaps the Raspbery Pi comes with JavaScriptCore 3 instead of 4 (which is on Ubuntu 16.04). There are odd unresolved issues that occur with JavaScriptCore 3, and the build is currently trying to sidestep them by bundling things with whitespace only Closure optimizations (as opposed to simple). If you notice that CMake detects javascriptcoregtk-3.0 in the step above, then you could re-do your Ubuntu portion of the build by running JAVASCRIPT_CORE=3 script/build as opposed to just script/build. This way the tree you copy over will have whitespace only optimizations applied.

pyrmont commented 5 years ago

Just as an update, I'm able to successfully build Planck 2.21.0 from a clone of the GitHub repository on a Raspberry Pi 3 Model B running Raspbian Stretch (ie. version 9). I installed the build dependencies listed in the wiki for Debian 9.

The build process is understandably very slow but I experienced no errors and the Planck executable runs without the segfault described in the OP.

I do see the same behaviour where the initial evaluation is very slow. Once this evaluation is complete, other evaluations are run quickly. I installed JavaScriptCore 4 and so do not think that's the culprit.

If I had to hazard a guess, I'd assume there's some sort of processing step that JSC is performing that isn't run until the first form is processed.