Skip to content

Performance First

Performance is the core value of Ocyrusjs. Every module is built with two non-negotiable principles.

1. Zero-Allocation

Many JavaScript utilities create temporary objects or arrays as part of their logic. In high-frequency operations (like frame loops or high-throughput data processing), this creates "GC pressure"—the garbage collector has to run frequently, which can cause frame drops and latency.

Ocyrusjs minimizes allocations by:

  • Reusing buffers and objects where possible.
  • Using indexed loops instead of higher-order array methods.
  • Avoiding spread operators in hot paths.

2. High Execution Speed

We benchmark every module against the native engine implementation and popular alternatives (like Lodash). Our goal is to match or exceed the performance of the fastest existing solutions.

Benchmark Results

ModuleOcyrusjs Ops/secvs. Native / PopularImprovement
fastClone4.7Mvs. lodash/cloneDeep (1.0M)4.4x Faster
isPlainObject24Mvs. lodash/isPlainObject (5.4M)4.5x Faster
memo30.0Mvs. lodash/memoize (26.1M)1.15x Faster

To run the benchmarks yourself:

bash
npm run bench --workspaces

Released under the MIT License.