Skip to content

Commit e10862c

Browse files
committed
deploy: f11ea25
1 parent ec1255f commit e10862c

5 files changed

Lines changed: 3 additions & 58 deletions

File tree

architecture/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1641,7 +1641,7 @@ <h3 id="why-messagepack">Why MessagePack?</h3>
16411641
</tr>
16421642
</tbody>
16431643
</table>
1644-
<p>MessagePack is 2-5× faster than JSON for typical workloads and produces smaller payloads. Pickle is faster but not safe for cross-process communication.</p>
1644+
<p>MessagePack provides a compact binary format with strong typing, making it well-suited for cross-process communication over stdin/stdout.</p>
16451645
<h2 id="process-lifecycle">Process Lifecycle</h2>
16461646
<h3 id="startup">Startup</h3>
16471647
<ol>

examples/batch-operations/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,6 @@ <h2 id="key-points">Key Points</h2>
13611361
<li><code>batchExec()</code> executes multiple statements in one round-trip</li>
13621362
<li>Pool batch operations return <code>CompletableFuture&lt;List&lt;PythonValue&gt;&gt;</code></li>
13631363
<li>Timeout applies to the entire batch, not per-item</li>
1364-
<li>10-20× faster than sequential <code>eval()</code> for many small operations</li>
13651364
</ul>
13661365
<h2 id="run-it">Run It</h2>
13671366
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>./gradlew<span class="w"> </span>:python-embed-examples:batch-operations:run

index.html

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -289,17 +289,6 @@
289289
</label>
290290
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
291291

292-
<li class="md-nav__item">
293-
<a href="#why-pythonembed" class="md-nav__link">
294-
<span class="md-ellipsis">
295-
296-
Why PythonEmbed?
297-
298-
</span>
299-
</a>
300-
301-
</li>
302-
303292
<li class="md-nav__item">
304293
<a href="#quick-look" class="md-nav__link">
305294
<span class="md-ellipsis">
@@ -1319,17 +1308,6 @@
13191308
</label>
13201309
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
13211310

1322-
<li class="md-nav__item">
1323-
<a href="#why-pythonembed" class="md-nav__link">
1324-
<span class="md-ellipsis">
1325-
1326-
Why PythonEmbed?
1327-
1328-
</span>
1329-
</a>
1330-
1331-
</li>
1332-
13331311
<li class="md-nav__item">
13341312
<a href="#quick-look" class="md-nav__link">
13351313
<span class="md-ellipsis">
@@ -1375,38 +1353,6 @@
13751353
<h1 id="pythonembed">PythonEmbed</h1>
13761354
<p>Run Python code from Java — with full CPython compatibility and zero setup.</p>
13771355
<p>PythonEmbed embeds a real CPython interpreter in your JVM application via a subprocess + <a href="https://msgpack.org/">MessagePack</a> binary protocol — just pure Java and CPython. All C extensions (numpy, scipy, torch) work out of the box.</p>
1378-
<h2 id="why-pythonembed">Why PythonEmbed?</h2>
1379-
<table>
1380-
<thead>
1381-
<tr>
1382-
<th>Concern</th>
1383-
<th>PythonEmbed</th>
1384-
<th>Jython/GraalPy</th>
1385-
</tr>
1386-
</thead>
1387-
<tbody>
1388-
<tr>
1389-
<td>CPython compatibility</td>
1390-
<td>Full — numpy, scipy, torch, all C extensions</td>
1391-
<td>Limited to pure Python</td>
1392-
</tr>
1393-
<tr>
1394-
<td>Crash isolation</td>
1395-
<td>Python segfaults never kill the JVM</td>
1396-
<td>Native crash kills the JVM</td>
1397-
</tr>
1398-
<tr>
1399-
<td>Setup</td>
1400-
<td>One Gradle plugin line</td>
1401-
<td>Manual venv or JVM flag configuration</td>
1402-
</tr>
1403-
<tr>
1404-
<td>Performance</td>
1405-
<td>MessagePack binary protocol, 2–5× faster than JSON</td>
1406-
<td>In-process (JNI-based)</td>
1407-
</tr>
1408-
</tbody>
1409-
</table>
14101356
<h2 id="quick-look">Quick Look</h2>
14111357
<p>Add the Gradle plugin:</p>
14121358
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="n">plugins</span><span class="w"> </span><span class="o">{</span>

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

usage/batch/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1452,7 +1452,7 @@ <h2 id="why-batch">Why Batch?</h2>
14521452
2. Write to stdin (flush)
14531453
3. Read from stdout
14541454
4. Deserialize response (MessagePack)</p>
1455-
<p>Batch operations combine all requests into one MessagePack frame, eliminating N-1 round-trips. For many small evaluations, this can be <strong>10-20× faster</strong>.</p>
1455+
<p>Batch operations combine all requests into one MessagePack frame, eliminating N-1 round-trips.</p>
14561456
<h2 id="batch-with-pool">Batch with Pool</h2>
14571457
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a><span class="k">try</span><span class="w"> </span><span class="p">(</span><span class="n">PythonEmbedPool</span><span class="w"> </span><span class="n">pool</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">PythonEmbedPool</span><span class="p">.</span><span class="na">builder</span><span class="p">()</span>
14581458
<a id="__codelineno-2-2" name="__codelineno-2-2" href="#__codelineno-2-2"></a><span class="w"> </span><span class="p">.</span><span class="na">minPool</span><span class="p">(</span><span class="mi">2</span><span class="p">).</span><span class="na">maxPool</span><span class="p">(</span><span class="mi">8</span><span class="p">).</span><span class="na">options</span><span class="p">(</span><span class="n">PythonEmbed</span><span class="p">.</span><span class="na">Options</span><span class="p">.</span><span class="na">defaults</span><span class="p">())</span>

0 commit comments

Comments
 (0)