Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
python:pypy [2013/03/02 07:31] – DavidNaylorpython:pypy [2022/08/15 05:17] (current) – Add title section, remove uncessary horizontal rule KubilayKocak
Line 1: Line 1:
----- +====== PyPy ======
- +
-The development for lang/pypy is done at [[http://github.com/DragonSA/pypy|GitHub]]. +
- +
-====== Packages ====== +
-Pkgng packages for all supported %%FreeBSD%% versions will be provided in due course.+
  
 ====== Building ====== ====== Building ======
-Building [[/PyPy|PyPy]] can be done using the Ports Collection or directly from source.  The former is recommended.  See below for detailed discussions on the various aspects of building [[/PyPy|PyPy]]. 
  
-To install [[/PyPy|PyPy]] from ports:+Building %%PyPy%% can be done using the Ports Collection or directly from source.  The former is recommended.
  
-''%%# make -C /usr/ports/lang/pypy install%%''+The %%PyPy%% build process has two phases: 
 +  * The translation phase converts the language interpreter, written in RPython, into C code.  This is done using a python interpreter (currently either cPython or %%PyPy%%).  This is a single thread task.   
 +  * The compilation phase compiles the C code into a single executable.  This is a highly parallel task.  
  
-===== Instances =====+See below for detailed discussions on the various aspects of building %%PyPy%%.
  
-===== Custom Instances =====+To install %%PyPy%% from ports:
  
-===== Memory Requirements ===== +''%%# make -C /usr/ports/lang/pypy install%%''
-Building [[/PyPy|PyPy]] requires a lot of memory.  Most systems are not capable of building [[/PyPy|PyPy]], if this applies to your system please consider using a package as listed above.  [[/PyPy|PyPy]] is also capable of building itself which, thanks to the JIT, is faster than using Python but also uses more memory.  This behaviour is a port option, dependent on ''%%${LOCALBASE}/bin/pypy%%'' being present. +
- +
-By default [[/PyPy|PyPy]] builds all instances in parallel which stacks the required memory (i.e. each build will use the maximum memory listed below).  If your system has sufficient memory to build one [[/PyPy|PyPy]] instance but not multiple instances use the build flag ''%%-DDISABLE_MAKE_JOBS%%'' to build the [[/PyPy|PyPy]] instances in series. +
- +
-The [[/PyPy|PyPy]] port checks if your system has sufficient memory and refuses to build if it detects insufficient memory.  This behaviour can be overwritten with the build flag ''%%-DPYPY_IGNORE_MEMORY%%''.  Each extra level of optimisation requires more memory when building [[/PyPy|PyPy]], with the JIT taking the most memory, so consider using a lower level of optimisation if memory is a limitation and disabling the memory checks however the primary reason to use [[/PyPy|PyPy]] is for the JIT and the associated performance improvements. +
- +
-The following memory requirements were determined using ''%%sh -c "rm -f /tmp/stop; (while [ ! -f /tmp/stop ]; do ps -o rss,comm | grep -R '(python|pypy)'; sleep 1; done) | sort -n | tail -n 1"%%'' on an x86_64 system: +
- +
-^ Translator ^ 32-bit ^ 64-bit ^ +
-| python2.7 | 2.1GiB | 4.3GiB | +
-| pypy2.0 | 2.4GiB | 5.5GiB | +
-| System | 0.2GiB | 0.4GiB | +
- +
-See ''%%${PORTSDIR}/lang/pypy/Makefile%%'' for more accurate figures. +
- +
-===== Compilation Time ===== +
-[[/PyPy|PyPy]] takes a long time to build.  The "translation" phase of building [[/PyPy|PyPy]] can take most of the time however using only a single core per instance.  If concurrency is disables, via ''%%-DDISABLE_MAKE_JOBS%%'' then the compilation phase can also take a signification amount of time. +
- +
-The following times are based on an Intel Core i7-2600: +
- +
-| **Translator** | Phase | **32-bit** | **64-bit** | +
-| python2.7 | Translation | 79 mins | 180 mins | +
-| ::: | Compilation | ?? mins | ?? mins | +
-| ::: | //Total// | //??? mins// | //??? mins// | +
-| pypy2.0 | Translation | 34 mins | 90 mins | +
-| ::: | Compilation | ?? mins | ?? mins | +
-| ::: | //Total// | //??? mins// | //??? mins// |+
  
 ===== Building without port ===== ===== Building without port =====
-See [[http://pypy.org/download.html#building-from-source|instructions]] provided by the [[/PyPy|PyPy]] project on building [[/PyPy|PyPy]] directly from source. +See [[http://pypy.org/download.html#building-from-source|PyPy instructions]] on building %%PyPy%% directly from source.
- +
-====== Status ======+
  
 ====== TODO ====== ====== TODO ======
-  * Detect MAKE_JOBS_NUMBER and use min(MAKE_JOBS_NUMBER, COUNT(PYPY_INST%%))%% when detecting memory requirements. +  * Properly check sandbox support and create sandbox VM-thing (does upstream support sandboxing?) 
-  * Make a pypy-devel port (of nightlies, for fixing pypy on %%FreeBSD%%) +  * Add pypy-based numpy port??? 
-  * Make a jitviewer port (depends pn flask pygments simplejson Jinja2 Werkzeug)+  * Make a jitviewer port (depends on flask pygments simplejson Jinja2 Werkzeug)
   * Support valgrind   * Support valgrind
-  * Properly check sandbox support and create sandbox VM-thing +  * Integrate %%PyPy%% into bsd.python.mk
-  * Integrate [[/PyPy|PyPy]] into bsd.python.mk+
  
  • python/pypy.1362209493.txt.gz
  • Last modified: 2013/03/02 07:31
  • by DavidNaylor