Claim Missing Document
Check
Articles

Found 1 Documents
Search

Perbandingan Kinerja Operator == dan Fungsi Compare() dalam Pemrosesan String pada C++ Fasyih, Muhammad Rofi Nur; Dea Karuniawati; Pasha Ferbitama; Elvina Rizqi; Imam Prayogo Pujiono
TAMIKA: Jurnal Tugas Akhir Manajemen Informatika & Komputerisasi Akuntansi Vol 5 No 2 (2025): TAMIKA: Jurnal Tugas Akhir Manajemen Informatika & Komputerisasi Akuntansi
Publisher : Universitas Methodist Indonesia

Show Abstract | Download Original | Original Source | Check in Google Scholar | DOI: 10.46880/tamika.Vol5No2.pp344-349

Abstract

This study compared the performance of the equality operator (==) and the compare() function in C++ for strings. The focus was on their speed and memory efficiency when processing large data sets. Three datasets containing 100, 1,000, and 10,000 random strings ranging in length from 5 to 10 characters were used, each tested three times. Time was measured in microseconds, while memory usage was calculated in kilobytes. The results showed that the compare() function was faster, about 42% faster on the 100-string dataset, and about 9% to 10% faster on larger datasets. Memory usage was similar, differing by only a few hundred bytes. Therefore, use the equality operator (==) for simple comparisons or on small datasets, and use the compare() function for larger data sets. Further research should examine the impact of different compilers, optimization levels, and C++ standard library implementations on these results, as well as include formal statistical analysis of the measured data.