Twitxy Saved

Vincenzo Petrucci

Verified account This account is verified. Learn more

@nahime0

๐Ÿ›  Indie Founder building AI dev tools

โ†’ elephc.dev (fast PHP compiler)
โ†’ lazyagent.dev (AI agents manager)

+ other open source projects
ha.cking.it Joined June 2025
158 Following 539 Followers 645 Posts

Latest posts 5

Pinned post

Vincenzo Petrucci Verified account @nahime0
What if PHP didn't need an interpreter to run?

No PHP installation.
No external runtime dependencies.
Just a native executable.

Meet Elephc ๐Ÿ˜

PHP compiled to native machine code. Built in Rust.

elephc.dev
elephc.dev elephc โ€” PHP to Native Assembly Compiler elephc is an open-source PHP compiler that compiles a static subset of PHP to native assembly. No interpreter, no VM, no Zend Engine, no opcode fallback.
Jake Casto Verified account @0x15f Oct 11
coming soon
View quoted post on X
19 replies 34 reposts 294 likes 19K views View on X
Vincenzo Petrucci Verified account @nahime0
36.8 s โ†’ 4.0 s.

Same PHP code. One merged elephc PR (#2338), driven by hot paths from a real project:

- 1,000 hash removals: 60 ms โ†’ ~0.05 ms (no cycle collection after unsetting scalars)
- foreach over a hash of objects: 1,000 allocations โ†’ 0
- $x === null guards: 10,000 allocations โ†’ 0
- GC now budgeted by heap size, like PHP's root buffer
4 replies 4 reposts 41 likes 1.2K views View on X
Vincenzo Petrucci Verified account @nahime0
19โ€“29x faster than PHP. With OPcache + JIT on.

Results are in. elephc's official CI, PHP 8.5 with opcache + tracing JIT:

โ€ข sum_loop: 58.8 ms โ†’ 3.0 ms
โ€ข array_sum: 56.8 ms โ†’ 2.9 ms
โ€ข string_concat: 58.5 ms โ†’ 2.0 ms

Whole-process time, startup included. A native binary has nothing to boot.

C is in the chart too ๐Ÿ‘€
14 replies 8 reposts 102 likes 4.6K views View on X
Vincenzo Petrucci Verified account @nahime0
The #1 reply to yesterday's benchmark: "Now turn on OPcache and JIT."

Fair. So we did.

Every PHP baseline in elephc's CI now runs with:
โ€ข opcache.enable_cli=1
โ€ข opcache.jit=tracing
โ€ข jit_buffer_size=128M

And a probe checks the JIT is really on. If not, CI fails.

PHP at full speed vs native code. Results tomorrow.

Your guess: does the gap shrink, stay, or grow? ๐Ÿ‘‡
1 replies 3 reposts 38 likes 2.4K views View on X
Vincenzo Petrucci Verified account @nahime0
PHP syntax. Native binary. ~20x faster than PHP.

elephc vs PHP 8.5 vs C, official CI:
sum_loop: 2.7 / 50.8 / 1.8 ms
array_sum: 2.4 / 52.8 / 2.2 ms
string_concat: 2.3 / 52.0 / 3.2 ms

Whole process, startup included.

What should we benchmark next?