📄 Abstract
Database and array-processing engines routinely offer a built-in REVERSE() operator alongside the option for developers to supply a user-defined function (UDF). Practitioner folklore holds that a hand-written, in-place UDF that performs no secondary heap allo-cation should outperform an allocating built-in equivalent, yet this claim is rarely isolated and measured in a controlled setting. This paper reports a case study that implements ARRAY_REVERSE_UDF, an in-place, O(1)-auxiliary-space reversal routine, against an allocat-ing, builtin-style REVERSE() that returns a newly allocated buffer, and benchmarks both in C (GCC 13.3.0, -O2, Ubuntu 24.04.4 LTS) across array sizes from 102 to 107 32-bit integers, with 30 random-ized, interleaved repetitions per configuration. Execution time, CPU utilization, peak resident memory, minor page faults, and throughput were measured directly; mean, median, standard deviation, 95% con-fidence intervals, Cohen’s d, Welch’s t-test, and the Mann–Whitney U test were computed for every array size. The results do not support a simple monotonic advantage for the in-place UDF: it was significantly faster at n ≤ 1,000 and, dramatically, at n = 107 (3.92×, driven by roughly 1.50 million minor page faults for the allocating variant versus 19,596 for the UDF), yet significantly slower by approximately 8% for 105 ≤ n ≤ 106, and statistically indistinguishable at n = 104. A supplementary optimization-level sweep (-O0, -O2, -O3) shows that this reversal is sensitive to auto-vectorization and is not a fixed property of the algorithm alone. All code, raw measurements, and figures are described for independent reproduction; where a specific measurement could not be obtained in the evaluation environment (hardware cache-miss counters), this is stated explicitly rather than estimated.
🏷️ Keywords
📚 How to Cite:
Cadet S Navanitha Krishnan , Cadet S Hari Santh , PERFORMANCE IMPACT OF SECONDARY MEMORY ALLOCATION IN ARRAY REVERSAL OPERATIONS: AN EMPIRICAL CASE STUDY OF ARRAY_REVERSE_UDF VERSUS BUILT-IN REVERSE() , Volume 12 , Issue 8, August 2026, EPRA International Journal of Multidisciplinary Research (IJMR) , Pages: 280 - 291 ,