Running modern routes on IgniteCore's isolated CodeIgniter 4.7.6 runtime cuts Perfex CRM HTTP median latency by 32% (from 342.4 ms down to 234.4 ms), halves peak memory usage (2.00 MB vs 4.00 MB), and reduces loaded PHP files per request by 61% (123 vs 313 files). For stateless endpoints such as /ignite/api/v1/health, median response time drops 75% to 84.8 ms, while the Pre-Boot OPcache dispatcher adds less than 0.5 ms of routing overhead.
Why Stock Perfex CRM CI3 Slows Down Under Real Workloads
Perfex CRM's core CodeIgniter 3.1.11 bootstrap loads the entire monolith regardless of how lightweight a given endpoint is. Even a simple JSON status lookup or small table fetch pays the full initialization tax on every HTTP request:
- Heavy Global Autoload Tax: Every standard CI3 request autoloads 47 helpers, 10 core libraries, 4 models, and hooks across all active legacy modules. On a production instance with installed add-ons, PHP compiles or resolves 313 PHP files and consumes 4.00 MB of peak memory before your controller executes meaningful business logic.
- All-Module Hook Discovery: Because CI3 modules register hooks globally during boot, unrelated add-ons still load metadata, language files, and helper functions even when the target URL belongs to a single API or reporting screen.
- PHP Session Lock Contention: Standard CI3 sessions hold an exclusive lock on the session record until the entire HTTP request finishes. When a CRM dashboard fires 4 to 6 concurrent AJAX requests for charts, notifications, and table filters, PHP serializes those requests one after another instead of serving them in parallel.
Measured PHP 8.3 + OpenLiteSpeed Benchmark Results
To verify real-world runtime gains without synthetic distortion, IgniteCore runs identical workloads on the same Perfex CRM server running PHP 8.3 and OpenLiteSpeed.
HTTP median latency, server execution time, peak PHP memory, and loaded file footprint
|
Benchmark Target & Endpoint
|
HTTP Median Latency
|
Server Execution Time
|
Peak PHP RAM
|
Loaded PHP Files
|
Key Improvement vs CI3
Verified
|
|---|---|---|---|---|---|
Perfex Core CI3 (/admin/ignite_core/bench_ci3)
|
342.4 ms
|
0.40 ms
|
4.00 MB
|
313 files
|
Baseline monolith |
IgniteCore CI4 Runtime (/admin/ignite_core/bench_ci4)
|
234.4 ms
|
0.22 ms
|
2.00 MB
|
123 files
|
|
Stateless CI4 Health API (/ignite/api/v1/health)
|
84.8 ms
|
0.16 ms
|
Minimal stateless footprint | Lightweight CI4 API boot | |
Pre-Boot Front-Dispatcher (route_manifest.php OPcache)
|
< 0.5 ms overhead
|
Sub-millisecond pre-boot | Negligible | Pure PHP manifest lookup | Zero dual-kernel collision (< 0.5 ms) |
Measured live on PHP 8.3 + OpenLiteSpeed against the same Perfex CRM database.
Two measurements stand out for engineering teams evaluating ROI:
- Authenticated Admin Routes Gain Speed Without Losing Context:
/admin/ignite_core/bench_ci4still authenticates the Perfex staff session (tblsessions), validates RBAC (tblstaff_permissions), reads CRM options, and enforces CSRF. Even with full CRM context active, cutting loaded files from313to123reduces memory pressure by 50% and trims HTTP median response time by over108 ms. - Stateless APIs Break Free of Monolith Overhead: Endpoints routed via
/ignite/api/v1/*skip heavy session and admin UI bootstrapping altogether, hitting84.8 msHTTP median latency (0.16 msinternal execution) on the exact same server and database.
Eliminating Parallel AJAX Bottlenecks with SessionReadOnlyFilter
Peak latency tells only half the performance story. Concurrency bottlenecks in Perfex CRM often stem from PHP session locking rather than slow SQL queries. When a controller reads sp_session to identify the current staff user and leaves the session open during external HTTP calls or heavy report generation, any parallel AJAX request from the same browser tab blocks waiting for the lock.
IgniteCore solves this through SessionReadOnlyFilter (registered as sessionReadOnly in ignite/manifest.php routes). Immediately after PerfexDatabaseSessionHandler or FileHandler verifies the staff or client identity and loads required session context, the filter invokes session_write_close() before the controller begins heavy computation or I/O. Read-only dashboards, Data Builder queries, and concurrent analytics widgets execute genuinely in parallel without blocking the user's active Perfex session.
Inside Ignite_core_diagnostics_suite: Apples-to-Apples Live Testing
Benchmark claims are only trustworthy when teams can reproduce them on their own hosting hardware, PHP version, and active module count. IgniteCore embeds Ignite_core_diagnostics_suite directly inside Setup > IgniteCore so administrators can test CI3 vs CI4 side by side against their live database.
4 Identical Workload Steps Per Round
Every benchmark round executes the exact same 4 operations on both /admin/ignite_core/bench_ci3 and /admin/ignite_core/bench_ci4:
- Raw Database Ping (
SELECT 1): Measures baseline database connection and query driver overhead. - Option Resolution (
get_option('companyname')): Compares CI3 core option loading againstPerfexOptionsServiceon CI4. - Staff Record Lookup (
tblstaff): Queries active staff metadata to test ORM/Query Builder hydration speed. - 50-Record SHA-256 JSON Payload: Fetches 50 structured records and computes deterministic SHA-256 hashes across payloads to benchmark serialization, CPU looping, and JSON encoding under identical data volume.
Configurable 5 / 10 / 20-Round Runs, P95, and JSON Export
Rather than relying on a single lucky request, Ignite_core_diagnostics_suite supports 5, 10, or 20 sequential rounds, calculates both HTTP Median and P95 tail latency, records Server Exec, Peak RAM, and Loaded File Count from each runtime, and provides a one-click JSON export for regression tracking before and after hosting or PHP upgrades.
Frequently Asked Questions
Why is the Pre-Boot Front-Dispatcher overhead under 0.5 ms?
bootstrap/dispatcher.php evaluates incoming URIs against a precompiled OPcache-friendly PHP array (route_manifest.php) before autoloading Composer, CI4 services, or CI3 core files. If a URI is not an active CI4 route, control hands off immediately to Perfex's index.php.
Does reducing loaded PHP files from 313 to 123 break legacy modules?
No. The 123 file count applies strictly to routes handled by IgniteCore's CI4 runtime. Any legacy Perfex route falls back to standard CI3 execution and loads the full legacy environment as usual.
When should developers apply SessionReadOnlyFilter?
Apply sessionReadOnly to any CI4 route that reads staff or client identity for dashboards, charts, search endpoints, exports, or APIs that do not mutate PHP session flashdata. Routes that actively write to $_SESSION should omit the filter.
Can we run the live benchmark suite on production safely?
Yes. bench_ci3 and bench_ci4 are protected by staffAuth and staffCan (tblstaff_permissions), execute read-only lookups plus in-memory SHA-256 hashing, and run on demand in 5, 10, or 20 short rounds without mutating business tables.
Related Guides
- IgniteCore for Perfex CRM Product Page
- Complete IgniteCore for Perfex CRM Runtime & Architecture Guide
- CodeIgniter 3 vs CodeIgniter 4 Security in Perfex CRM: IgniteCore Deep-Dive
- Strangler Fig Architecture: How IgniteCore Bridges CI3 and CI4 in Perfex CRM
- Accelerating Data Builder v2 APIs on CI4 Without Vendor Lock-In
Need a Custom Perfex CRM Module, Bug Fix, or CodeIgniter 4 Upgrade?
Avoid broken updates, PHP 8.2-8.4 errors, and risky core edits. HeadRandom provides custom Perfex CRM module development, upgrade, and bug-fixing services for any third-party or custom module on your Perfex CRM installation, plus upgrading Perfex CRM from CodeIgniter 3 to CodeIgniter 4 via IgniteCore for Perfex CRM.
Develop new custom modules from scratch, patch bugs or hook conflicts on existing client modules, and update legacy code for clean PHP 8.2-8.4 compatibility with zero core file hacks. View Perfex CRM module development scope.
Migrate your Perfex CRM runtime to CodeIgniter 4 (4.7.6) using IgniteCore for Perfex CRM (independent module by HeadRandom) with Dual-Mode CI3 fallback, 32% to 75% lower latency, 50% less RAM, and custom CI4 porting for third-party modules. See CI3 to CI4 upgrade options.
Combine 2+ HeadRandom services (Custom Module, IgniteCore CI4 Upgrade, or Website Care) to save 30% automatically.