Skip to content

Commit 43630d8

Browse files
docs update
1 parent 812f0f7 commit 43630d8

17 files changed

+243
-164
lines changed

docs/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 9916125ae8fbc6b931a6987aa12f983d
3+
config: 614f580883a5bffb7f1606004f7be223
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

docs/BUILDING.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<title>Building from source &mdash; Raylib Python documentation</title>
88
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
99
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
10-
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=eafc0fe6" />
10+
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=fd3f3429" />
1111

1212

1313
<!--[if lt IE 9]>
@@ -17,7 +17,7 @@
1717
<script src="_static/jquery.js?v=5d32c60e"></script>
1818
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
1919
<script src="_static/documentation_options.js?v=5929fcd5"></script>
20-
<script src="_static/doctools.js?v=888ff710"></script>
20+
<script src="_static/doctools.js?v=9a2dae69"></script>
2121
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
2222
<script src="_static/js/theme.js"></script>
2323
<link rel="index" title="Index" href="genindex.html" />

docs/README.html

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<title>Python Bindings for Raylib 5.0 &mdash; Raylib Python documentation</title>
88
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
99
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=19f00094" />
10-
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=eafc0fe6" />
10+
<link rel="stylesheet" type="text/css" href="_static/graphviz.css?v=fd3f3429" />
1111

1212

1313
<!--[if lt IE 9]>
@@ -17,7 +17,7 @@
1717
<script src="_static/jquery.js?v=5d32c60e"></script>
1818
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
1919
<script src="_static/documentation_options.js?v=5929fcd5"></script>
20-
<script src="_static/doctools.js?v=888ff710"></script>
20+
<script src="_static/doctools.js?v=9a2dae69"></script>
2121
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
2222
<script src="_static/js/theme.js"></script>
2323
<link rel="index" title="Index" href="genindex.html" />
@@ -193,7 +193,6 @@ <h1>Running in a web browser<a class="headerlink" href="#running-in-a-web-browse
193193
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span># /// script
194194
# dependencies = [
195195
# &quot;cffi&quot;,
196-
# &quot;inflection&quot;,
197196
# &quot;raylib&quot;
198197
# ]
199198
# ///
@@ -250,10 +249,18 @@ <h1>License (updated)<a class="headerlink" href="#license-updated" title="Link t
250249
</section>
251250
<section id="performance">
252251
<h1>Performance<a class="headerlink" href="#performance" title="Link to this heading"></a></h1>
253-
<p>For fastest performance use Pypy rather than standard Python.</p>
254-
<p>Every call to C is costly, so it’s slightly faster if you use Python data structures and functions when calculating
252+
<p>If you need more performance, do in this order:</p>
253+
<ol class="arabic simple">
254+
<li><p>Use Pypy rather than standard CPython. It is much, much faster and will make more difference than any other optimisations you might do.</p></li>
255+
<li><p>Every call to C is costly, so it’s slightly faster if you use Python data structures and functions when calculating
255256
in your update loop
256-
and then only convert them to C data structures when you have to call the C functions for drawing.</p>
257+
and then only convert them to C data structures when you have to call the C functions for drawing.</p></li>
258+
<li><p>The raylib.* functions are potentially 1.5x faster than the pyray.* equivalents, so if you need a tiny bit more performance
259+
you can switch your inner loop functions to these.</p></li>
260+
<li><p>There is a version of Python that is faster than Pypy: GraalPy. However it’s not fully compatible with all Python
261+
packages. It doesn’t work with CFFI and so doesn’t work with this binding. But it <em>is</em> compatible with the
262+
<em>Java</em> binding, Jaylib! There is an example of this here: https://github.com/electronstudio/megabunny/tree/master/raylib-python-jaylib</p></li>
263+
</ol>
257264
<section id="bunnymark">
258265
<h2>Bunnymark<a class="headerlink" href="#bunnymark" title="Link to this heading"></a></h2>
259266
<table class="docutils align-default">
@@ -265,33 +272,49 @@ <h2>Bunnymark<a class="headerlink" href="#bunnymark" title="Link to this heading
265272
</tr>
266273
</thead>
267274
<tbody>
268-
<tr class="row-even"><td><p>Raylib 3.7</p></td>
275+
<tr class="row-even"><td><p>Raylib 5.0</p></td>
276+
<td><p>C</p></td>
277+
<td><p>180000</p></td>
278+
<td><p>100%</p></td>
279+
</tr>
280+
<tr class="row-odd"><td><p>Raylib Python CFFI 5.0.0.2</p></td>
281+
<td><p>Python 3.12</p></td>
282+
<td><p>10500</p></td>
283+
<td><p>5.8%</p></td>
284+
</tr>
285+
<tr class="row-even"><td><p>Raylib Python CFFI 5.0.0.2</p></td>
286+
<td><p>Pypy 3.10</p></td>
287+
<td><p>95000</p></td>
288+
<td><p>53%</p></td>
289+
</tr>
290+
<tr class="row-odd"><td><p>Raylib 3.7</p></td>
269291
<td><p>C</p></td>
270292
<td><p>168100</p></td>
271293
<td><p>100%</p></td>
272294
</tr>
273-
<tr class="row-odd"><td><p>Raylib Python CFFI 3.7</p></td>
295+
<tr class="row-even"><td><p>Raylib Python CFFI 3.7</p></td>
274296
<td><p>Pypy 3.7</p></td>
275297
<td><p>33800</p></td>
276298
<td><p>20%</p></td>
277299
</tr>
278-
<tr class="row-even"><td><p>Raylib Python CFFI 3.7</p></td>
300+
<tr class="row-odd"><td><p>Raylib Python CFFI 3.7</p></td>
279301
<td><p>Python 3.9</p></td>
280302
<td><p>7700</p></td>
281303
<td><p>4.5%</p></td>
282304
</tr>
283-
<tr class="row-odd"><td><p>Raylib Python CFFI 3.7</p></td>
305+
<tr class="row-even"><td><p>Raylib Python CFFI 3.7</p></td>
284306
<td><p>Python 3.9 Nuitka</p></td>
285307
<td><p>8600</p></td>
286308
<td><p>5.1%</p></td>
287309
</tr>
288-
<tr class="row-even"><td><p>Raylib Python CFFI 3.7 Dynamic</p></td>
310+
<tr class="row-odd"><td><p>Raylib Python CFFI 3.7 Dynamic</p></td>
289311
<td><p>Python 3.9</p></td>
290312
<td><p>6300</p></td>
291313
<td><p>3.7%</p></td>
292314
</tr>
293315
</tbody>
294316
</table>
317+
<p>See also https://github.com/electronstudio/megabunny/</p>
295318
</section>
296319
</section>
297320
<section id="packaging-your-app">

docs/_sources/README.md.txt

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Python Bindings for Raylib 5.0
22

3-
<iframe src="https://electronstudio.github.io/raylib-python-cffi-pygbag-examples/shapes_bouncing_ball/build/web/" style="border:0px #ffffff none;" name="myiFrame" scrolling="no" frameborder="1" marginheight="0px" marginwidth="0px" height="450px" width="800px" allowfullscreen></iframe>
4-
53
Chatroom: [Discord](https://discord.gg/fKDwt85aX6) or [Matrix](https://matrix.to/#/#raylib-python-cffi:matrix.org)
64

75
New CFFI API static bindings.
@@ -94,7 +92,6 @@ Make a folder `my_project` with a file `main.py`:
9492
# /// script
9593
# dependencies = [
9694
# "cffi",
97-
# "inflection",
9895
# "raylib"
9996
# ]
10097
# ///
@@ -153,22 +150,36 @@ statically link and use in non-free / proprietary / commercial projects!
153150

154151
# Performance
155152

156-
For fastest performance use Pypy rather than standard Python.
153+
If you need more performance, do in this order:
154+
155+
1. Use Pypy rather than standard CPython. It is much, much faster and will make more difference than any other optimisations you might do.
157156

158-
Every call to C is costly, so it's slightly faster if you use Python data structures and functions when calculating
157+
2. Every call to C is costly, so it's slightly faster if you use Python data structures and functions when calculating
159158
in your update loop
160159
and then only convert them to C data structures when you have to call the C functions for drawing.
161160

161+
3. The raylib.* functions are potentially 1.5x faster than the pyray.* equivalents, so if you need a tiny bit more performance
162+
you can switch your inner loop functions to these.
163+
164+
4. There is a version of Python that is faster than Pypy: GraalPy. However it's not fully compatible with all Python
165+
packages. It doesn't work with CFFI and so doesn't work with this binding. But it *is* compatible with the
166+
*Java* binding, Jaylib! There is an example of this here: https://github.com/electronstudio/megabunny/tree/master/raylib-python-jaylib
167+
162168
## Bunnymark
163169

164170

165-
| Library | Implementation | Bunnies (60 FPS) | Percentage |
166-
| ------------- | ------------- | ------------- | ------------- |
167-
| Raylib 3.7 | C | 168100 | 100% |
168-
| Raylib Python CFFI 3.7 | Pypy 3.7 | 33800 | 20% |
169-
| Raylib Python CFFI 3.7 | Python 3.9 | 7700 | 4.5% |
170-
| Raylib Python CFFI 3.7 | Python 3.9 Nuitka | 8600 | 5.1% |
171-
| Raylib Python CFFI 3.7 Dynamic | Python 3.9 | 6300 | 3.7% |
171+
| Library | Implementation | Bunnies (60 FPS) | Percentage |
172+
|--------------------------------|-------------------|------------------|------------|
173+
| Raylib 5.0 | C | 180000 | 100% |
174+
| Raylib Python CFFI 5.0.0.2 | Python 3.12 | 10500 | 5.8% |
175+
| Raylib Python CFFI 5.0.0.2 | Pypy 3.10 | 95000 | 53% |
176+
| Raylib 3.7 | C | 168100 | 100% |
177+
| Raylib Python CFFI 3.7 | Pypy 3.7 | 33800 | 20% |
178+
| Raylib Python CFFI 3.7 | Python 3.9 | 7700 | 4.5% |
179+
| Raylib Python CFFI 3.7 | Python 3.9 Nuitka | 8600 | 5.1% |
180+
| Raylib Python CFFI 3.7 Dynamic | Python 3.9 | 6300 | 3.7% |
181+
182+
See also https://github.com/electronstudio/megabunny/
172183

173184
# Packaging your app
174185

@@ -183,4 +194,4 @@ You can create a standalone binary using the Nuitka compiler. For example, here
183194
[RetroWar: 8-bit Party Battle](https://store.steampowered.com/app/664240/RetroWar_8bit_Party_Battle/?git) is out now. Defeat up to 15 of your friends in a tournament of 80s-inspired retro mini games.
184195

185196
[Coding Games With Pygame Zero & Python](https://github.com/electronstudio/pygame-zero-book) is
186-
a book for Python beginners.
197+
a book for Python beginners.

docs/_static/basic.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Sphinx stylesheet -- basic theme.
66
*
7-
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/

docs/_static/doctools.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Base JavaScript utilities for all Sphinx HTML documentation.
66
*
7-
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/

docs/_static/graphviz.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Sphinx stylesheet -- graphviz extension.
66
*
7-
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
7+
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
88
* :license: BSD, see LICENSE for details.
99
*
1010
*/

docs/_static/language_data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
* This script contains the language-specific data used by searchtools.js,
66
* namely the list of stopwords, stemmer, scorer and splitter.
77
*
8-
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
8+
* :copyright: Copyright 2007-2024 by the Sphinx team, see AUTHORS.
99
* :license: BSD, see LICENSE for details.
1010
*
1111
*/
1212

1313
var stopwords = ["a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "near", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"];
1414

1515

16-
/* Non-minified version is copied as a separate JS file, is available */
16+
/* Non-minified version is copied as a separate JS file, if available */
1717

1818
/**
1919
* Porter Stemmer

0 commit comments

Comments
 (0)