Performance comparison of different string matching methods in PHP.
Test Setup:
- String length: 76,000 bytes
- Iterations: 1000 per method
- Each test run was a separate, sequential
phpCLI call to minimize interference
| { | |
| "$schema": "https://playground.wordpress.net/blueprint-schema.json", | |
| "landingPage": "/?p=4", | |
| "login": true, | |
| "steps": [ | |
| { | |
| "step": "installTheme", | |
| "themeData": { | |
| "resource": "wordpress.org/themes", | |
| "slug": "twentyfifteen" |
| // Credit: Dennis Snell (@dmsnell) | |
| digraph G { | |
| rankdir=TB; | |
| nodesep=0.5; | |
| ranksep=0.8; | |
| fontname="sans-serif"; | |
| // Entry point | |
| entry [shape=plaintext label="Open script"]; | |
| entry -> script_data; |
| import { oneDarkHighlightStyle } from '@codemirror/theme-one-dark'; | |
| import { classHighlighter } from '@lezer/highlight'; | |
| import { defaultHighlightStyle } from '@codemirror/language'; | |
| const ss = new CSSStyleSheet(); | |
| for (const spec of oneDarkHighlightStyle.specs) { | |
| const { tag: _tags, class: _, ...rules } = spec; | |
| const tags: Extract<typeof _tags, readonly any[]> = Array.isArray(_tags) | |
| ? _tags |
| { | |
| "$schema": "https://playground.wordpress.net/blueprint-schema.json", | |
| "landingPage": "/", | |
| "phpExtensionBundles": [ | |
| "kitchen-sink" | |
| ], | |
| "steps": [ | |
| { | |
| "step": "mkdir", | |
| "path": "/wordpress-new" |
| FROM php:7.0-alpine | |
| COPY . . | |
| ENTRYPOINT ["php", "a.php"] |
| <body> | |
| <div | |
| data-wp-interactive='{"namespace":"jon/the-block"}' | |
| data-wp-context='{"val":0}' | |
| > | |
| <input | |
| readonly | |
| type="number" | |
| class="jon-val" | |
| data-wp-bind--value="context.val" |
| { | |
| "$schema": "https://schemas.wp.org/trunk/block.json", | |
| "apiVersion": 3, | |
| "title": "Jon's cool counter", | |
| "name": "jon/the-block", | |
| "editorScript": "file:./index.js", | |
| "viewScriptModule": "file:./view.js", | |
| "render": "file:./render.php", | |
| "category": "text" | |
| } |
| { | |
| "$schema": "https://schemas.wp.org/trunk/block.json", | |
| "apiVersion": 3, | |
| "title": "Jon's cool counter", | |
| "name": "jon/the-block", | |
| "editorScript": "file:./index.js", | |
| "viewModule": "file:./view.js", | |
| "render": "file:./render.php", | |
| "category": "text" | |
| } |