PAM Desktop vs Electron
Electron ships Chromium and Node.js with every application and renders the interface as a web page. PAM Desktop runs your PHP in a worker process and renders native platform views from a Rust host, with no browser in the rendering path. Both can build serious applications; they make different trade-offs. This page lays them out so you can choose with evidence rather than slogans.
The short version
Section titled “The short version”| PAM Desktop 2 | Electron | |
|---|---|---|
| Interface | Native views: GTK 4, AppKit, Win32 with Direct2D | A Chromium web page |
| Language | PHP 8.5 for everything | JavaScript or TypeScript, plus HTML and CSS |
| Processes | 2 (host and PHP worker) | Several (6 in the measured application) |
| CSS | A native subset: flexbox, grid tracks, tables, inline formatting, state selectors, media queries, variables | The full web platform |
| Ecosystem | Composer packages and the bundled PAM Desktop libraries | npm and the entire web ecosystem |
| Platform maturity | Linux reference; macOS verified in a VM; Windows not yet run | Mature on all three |
| Accessibility | Native APIs, not yet verified with a screen reader | Mature, through Chromium |
Resource use
Section titled “Resource use”Measured on Linux with the same point-of-sale application built on both (software rendering, same container, same data):
| PAM Desktop | Electron 37 | |
|---|---|---|
| Cold start to a complete screen | 138–151 ms | ~1.5 s |
| Route change (median) | 41 ms | 322 ms |
| Memory idle | 75 MB | 322 MB |
| Memory after scrolling 2,500 products | 143 MB | 657 MB |
| CPU idle, minimized | 0.0% | 1.0% |
| Installed directory | 120 MB | 468 MB |
Electron scrolled a long product grid slightly more smoothly in software rendering (about 59 against 55 updates per second). These are numbers from one application on one system; see Performance for the method, and measure your own application before deciding.
Choose PAM Desktop when
Section titled “Choose PAM Desktop when”- Your team and your domain code are PHP, and you want one language from database to interface.
- Startup time, memory and idle CPU matter: tools that stay open all day, point-of-sale terminals, older or shared machines.
- Native look and behavior matter: system text rendering, native inputs and menus, the platform’s accessibility APIs.
- Linux is a primary target, or you can validate macOS and Windows yourself during the current maturity window.
Choose Electron when
Section titled “Choose Electron when”- You need the full web platform: arbitrary CSS, canvas and WebGL libraries, rich text editors, or an existing web application to wrap.
- You need proven Windows and macOS support today, with signed auto-update infrastructure and years of production use.
- Your team works in JavaScript, and npm packages are central to the product.
- Screen reader support must be certified now.
Security is a design question
Section titled “Security is a design question”Electron’s security model is about isolating web content that can run arbitrary JavaScript: context isolation, sandboxed renderers, a preload bridge. PAM Desktop 2 has no web content in its rendering path, so the main question is simpler: your PHP runs with the user’s rights, like any native application, and untrusted input (web views, links, files, network data) must be validated. Neither model is automatically safe; see Security.
Evaluate with a spike
Section titled “Evaluate with a spike”A counter demo proves nothing. Rebuild your hardest screen in both: the longest list, the densest form, the screen with the most state. Measure cold start, memory after real navigation, idle CPU with the window visible and minimized, and package size, on the oldest machines and the operating systems you support.