Submitted:
18 January 2024
Posted:
19 January 2024
You are already at the latest version
Abstract
Keywords:
1. Introduction
- Highlighting the awareness of computer scientists, and especially programmers, that better computers do not solve the problems of shortening CPU time without careful implementation;
- Providing information about CPU spent time using two popular programming languages, C++ and Java;
- Testing the efficiency of the implementations on various platforms using different compilers.
2. Background
2.1. Move-To-Front Transform
| Algorithm 1 Pseudocode of MTF transform |
![]() |
2.2. Move with Interleaving
| Algorithm 2 Pseudocode of MwI transform |
![]() |
3. Materials and Methods
3.1. Implementation I-1
| Algorithm 3 Implementation I-1: initialization of L |
![]() |
| Algorithm 4 Implementation I-1: MwI main function |
![]() |
| Algorithm 5 Implementation I-1: L update function |
![]() |
3.2. Implementation I-2
| Algorithm 6 Implementation I-2: MwI with LUT |
![]() |
3.3. Implementation I-3
| Algorithm 7 Implementation I-3: MTF |
![]() |
| Algorithm 8 Implementation I-3: MwI |
![]() |
4. Experiments
- P1:
- A personal computer with AMD Ryzen 9 7950X3D 16-Core Processor clocked at 4.20 GHz, equipped with 64 GB of RAM, running the Windows 11 operating system. The code was compiled using MS Visual Studio, Version 17.4.2. OpenJDK-8-JRE was used for Java.
- P2:
- The same personal computer as in P1, but using Linux Kernel 6.6.8. with the Manjaro distribution. The code was compiled with G++ compiler Version 13.2.1. for C++. OpenJDK-8-JRE was used for Java again.
- P3:
- The Raspberry Pi 2 Model B running Raspbian GNU/Linux 11 (bullseye). The C++ code was compiled with gcc version 10.2.1 20210110 (Raspbian 10.2.1-6+rpi1), while OpenJDK-8-JRE was used for Java.
5. Conclusion
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Clark, B.G. An efficient implementation of the algorithm "CLEAN". Atron Astrophy. 1980, 89(3), 377–378. [Google Scholar]
- Hadjiconstantinou, E.; Christofides, N. An efficient implementation of an algorithm for finding K shortest simple paths. Int J Networks. 1999, 34(2), 88–101. [Google Scholar]
- Goldberg, A. V. An Efficient Implementation of a Scaling Minimum-Cost Flow Algorithm. J Algorithm. 1997, 22(1), 1–29. [Google Scholar] [CrossRef]
- Lippert, R.A.; Mobarry, C.M.; Walenz, B.P. A Space-Efficient Construction of the Burrows–Wheeler Transform for Genomic Data. J Comput Biol. 2005, 12(7), 943–951. [Google Scholar] [CrossRef] [PubMed]
- Devkota, S.; Aschwanden, P.; Kunen, A.; Legendre, M.; Isaacs, K. E. CcNav: Understanding Compiler Optimizations in Binary Code. IEEE T Vis Comput Gr. 2021, 27(2), 667–677. [Google Scholar] [CrossRef] [PubMed]
- Chattopadhyay, S. Compiler design, 2nd ed.; PHI Learning: New Delhi, India, 2022. [Google Scholar]
- Basford, P.J.; Johnston, S.J.; Perkins, C.S.; Garnock-Jones, T.; Tso, F.P.; Pezaros, D.; Mullins, R.D.; Yoneki, E.; Singer, J.; Cox, S.J. Performance analysis of single board computer clusters. Future Gener Comp Sy. 2020, 102, 278–291. [Google Scholar] [CrossRef]
- Khan, N.; Yaqoob, I.; Hashem, I.A.T.; Inayat, Z.; Ali, W.K.M.; Alam, M.; Shiraz, M.; Gani, A. Big Data: Survey, Technologies, Opportunities, and Challenges. Sci World J. 2014, 2014, 712826. [Google Scholar] [CrossRef] [PubMed]
- Stunkel, C.B.; Graham, R.L.; Shainer, G.; Kagan, M.; Sharkawi, S.S.; Rosenburg, B.; Chochoia, G.A. The high-speed networks of the Summit and Sierra supercomputers. IBM J Res Dev. 2020, 64(3/4), 3:1–3:10. [Google Scholar] [CrossRef]
- Iserte, S.; Prades, J.; Reaño, C.; Silla, F. Improving the management efficiency of GPU workloads in data centres through GPU virtualization. Concurr Comp-Pract E. 2019, 22(2), e5275. [Google Scholar]
- Khriji, S.; Benbelgacem, Y.; Chéour, R.; El Houssaini, D.; Kanoun, O. Design and implementation of a cloud-based event-driven architecture for real-time data processing in wireless sensor networks. J Supercomput. 2022, 78, 3374–3401. [Google Scholar] [CrossRef]
- Žlaus, D.; Mongus, D. Efficient method for parallel computation of geodesic transformation on CPU. IEEE T Parall Distr. 2020, 31(4), 935–947. [Google Scholar] [CrossRef]
- Qiu, M.; Ming, Z.; Li, J.; Gai, K.; Zong, Z. Phase-Change Memory Optimization for Green Cloud with Genetic Algorithm. IEEE T Comput. 2015, 64(12), 3528–3540. [Google Scholar] [CrossRef]
- Albers, S. Energy-efficient algorithms. Communications of the ACM 2010, 53(6), 86–96. [Google Scholar] [CrossRef]
- Žalik, B.; Strnad, D.; Podgorelec, D.; Kolingerová; Lukač, L.; Lukač, N.; Kolmanič, S.; Rizman Žalik, K.; Kohek, Š. A New Transformation Technique for Reducing Information Entropy: A Case Study on Greyscale Raster Images. Entropy 2023, 25(12), 1591. [Google Scholar] [CrossRef] [PubMed]
- Shannon, C.E. A Mathematical Theory of Communication. AT&T Tech J. 1948, 27(3), 379–423. [Google Scholar]
- Cover, T.M.; Thomas, J.A. Elements of Information Theory, 2nd ed.; Wiley: Hoboken, USA, 2006. [Google Scholar]
- Burrows, M.; Wheeler, D.J. A block-sorting lossless data compression algorithm. Technical report No. 124, Digital Systems Research Center, 1994.
- Adjeroh, D.; Bell, T.; Mukherjee, A. The Burrows-Wheeler Transform: Data Compression, Suffix Arrays, and Pattern Matching, 2nd ed.; Springer Science + Business Media: New York, USA, 2008. [Google Scholar]
- Abel., J. Post BWT stages of the Burrows-Wheeler compression Algorithm. Software Pract Exper. 2010, 40(9), 751–777. [Google Scholar] [CrossRef]
- Ryabko, B. Y. Data compression by means of a ’book stack’. Probl Inf Transm. 1980, 16(4), 265–269. [Google Scholar]
- Salomon, D.; Motta, G. Handbook of Data Compression, 5th ed.; Springer: London, U.K, 2010. [Google Scholar]
- Arnavut, Z.; Magliveras, S. S. Block sorting and compression. In Proceedings of the IEEE Data Compression Conference, DCC’97, Snowbird, Utah, USA, 25-27 Mar 1997; Storer, J. A., Cohn, M., Eds.; IEEE Computer Society Press: USA, 1997; pp. 181–190. [Google Scholar]
- Sayood, K. Introduction to Data Compression, 4th ed.; Morgan Kaufman, Elsevier: Waltham, USA, 2012. [Google Scholar]
- Rivest, R. On self-organizing sequential search heuristics. Comm of ACM. 1976, 19(2), 63–67. [Google Scholar] [CrossRef]
- Bentley, J. L.; Sleator, D. D.; Tarjan, R. E.; Wei, V. K. A Locally Adaptive Data Compression Scheme. Commun ACM. 1986, 29(4), 320–330. [Google Scholar] [CrossRef]
- Dorrigiv, R.; López-Ortiz, A.; Munro, J. I. An Application of Self-organizing Data Structures to Compression. In Experimental Algorithms, Proceedings of the 8th International Symposium on Experimental Algorithms, SEA 2009, Dortmund, Germany, 3-6 Jun 2009; Vahrenhold, J., Ed.; Lecture Notes in Computer Science 5526; Springer: Berlin, Germany, 2009; pp. 137–148. [Google Scholar]
- Jelenković, P.J.; Radovanović, A. Least-recently-used caching with dependent request. Theor Comput Sci. 2004, 2004 326, 293–327. [Google Scholar] [CrossRef]
- Žalik, B.; Lukač, N. Chain code lossless compression using Move-To-Front transform and adaptive Run-Length Encoding. Signal Process Image Commun. 2014, 29(1), 96–106. [Google Scholar] [CrossRef]
- Arnavut, Z. Move-To-Front and Inversion Coding. In Proceedings of the IEEE Data Compression Conference, DCC’2000, Snowbird, Utah, USA, 28-30 Mar 2000; Cohn, M., Storer, J. A., Eds.; IEEE Computer Society Press: USA, USA; pp. 193–202. [Google Scholar]
- Žalik, B.; Žalik, M.; Lipuš, B. On Move-To-Front Implementation. Proceedings on 27th International Conference on Circuits, Systems, Communications and Computers (CSCC), Rhodes Island, Greece, 19-22 July, 2023. IEEE Computer Society, Los Alamitos (CA), 2023; 43–47.
- Manber, U.; Myers, G. Suffix arrays: a new method for on-line string search. Proceedings of the first annual ACM-SIAM symposium on Discrete algorithms (SODA ’90), San Francisco (CA), USA, 22-24 Jan, 1990, Society for Industrial and Applied Mathematics, Philadelphia (PA); 319–327.
- Manber, U.; Myers, G. Suffix arrays: a new method for on-line string search. SIAM J Comput. 1993, 22(5), 935–948. [Google Scholar] [CrossRef]
- Nong, G.; Zhang, S.; Chan, W. H. Two efficient algorithms for linear time suffix array construction. IEEE T. Comput. 2011, 60(10), 1471–1484. [Google Scholar] [CrossRef]
- Kärkkäinen, J.; Sanders, P.; Burkhardt, S. Linear work suffix array construction. J. ACM. 2017, 53(6), 918–936. [Google Scholar] [CrossRef]
- Li, Z; Li, J.; Huo, H. Optimal In-Place Suffix Sorting. In String Processing and Information Retrieval, 25th International Symposium, SPIRE 2018, Lima, Peru, 9-11 Oct 2018; Gagie, T., Moffat, A., Navaro, G., Cuadros-Vargas, E., Eds.; Lecture Notes in Computer Science 11147; Springer: Cham, Germany, 2018; pp. 268–284. [Google Scholar]
- Stroustrup, B. The C++ Programming Language, 4th ed.; Addison-Wesley: Upper Saddle River, NJ, USA, 2013. [Google Scholar]
- What every programmer should know about memory. Available online: https://people.freebsd.org/~lstewart/articles/cpumemory.pdf (accessed on 30. 12. 2023).
- Cormen, T.H.; Leiserson, C.E.; Rivest, R.L.; Stein, C. Introduction to algorithms, 3th ed.; Massachusetts Institute of Technology: Cambridge, MA, USA, 2009. [Google Scholar]
- Repnik, B.; Žalik, B. Six implementations of MwI transform. Available online: https://gemma.feri.um.si/projects/slovene-national-research-projects/j2-4458-data-compression-paradigm-based-on-omitting-self-evident-information/software/ (accessed on 15. 01. 2024).


| X | n | P1 | P2 | P3 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| I-1 | I-2 | I-3 | I-1 | I-2 | I-3 | I-1 | I-2 | I-3 | ||
| (1) | 262,144 | 0.454 | 0.081 | 0.027 | 0.435 | 0.058 | 0.027 | 7.382 | 1.753 | 0.373 |
| (2) | 414,720 | 0.177 | 0.033 | 0.013 | 0.171 | 0.025 | 0.013 | 2.907 | 0.726 | 0.177 |
| (3) | 414,720 | 0.528 | 0.095 | 0.036 | 0.505 | 0.068 | 0.033 | 8.735 | 2.160 | 0.447 |
| (4) | 262,144 | 0.392 | 0.068 | 0.030 | 0.370 | 0.048 | 0.027 | 6.420 | 1.514 | 0.356 |
| (5) | 262,144 | 0.504 | 0.091 | 0.038 | 0.479 | 0.063 | 0.035 | 8.262 | 2.053 | 0.467 |
| (6) | 414,720 | 0.196 | 0.037 | 0.015 | 0.189 | 0.027 | 0.014 | 3.210 | 0.816 | 0.200 |
| (7) | 414,720 | 0.289 | 0.055 | 0.019 | 0.276 | 0.038 | 0.018 | 4.744 | 1.240 | 0.265 |
| (8) | 65,536 | 0.065 | 0.012 | 0.005 | 0.060 | 0.008 | 0.004 | 1.041 | 0.256 | 0.057 |
| (9) | 262,144 | 0.235 | 0.046 | 0.017 | 0.221 | 0.031 | 0.016 | 3.751 | 0.888 | 0.217 |
| (10) | 245,760 | 0.162 | 0.031 | 0.011 | 0.153 | 0.020 | 0.009 | 2.614 | 0.638 | 0.139 |
| (11) | 181,000 | 0.205 | 0.036 | 0.014 | 0.195 | 0.024 | 0.012 | 3.328 | 0.764 | 0.162 |
| (12) | 245,760 | 0.177 | 0.034 | 0.011 | 0.167 | 0.022 | 0.009 | 2.861 | 0.711 | 0.142 |
| (13) | 414,720 | 0.339 | 0.064 | 0.020 | 0.321 | 0.045 | 0.019 | 5.551 | 1.407 | 0.274 |
| (14) | 414,720 | 0.387 | 0.070 | 0.021 | 0.368 | 0.049 | 0.020 | 6.355 | 1.576 | 0.289 |
| (15) | 262,144 | 0.214 | 0.040 | 0.014 | 0.202 | 0.027 | 0.013 | 3.469 | 0.881 | 0.189 |
| (16) | 1,745,280 | 1.970 | 0.342 | 0.105 | 1.880 | 0.240 | 0.100 | 32.338 | 7.732 | 1.387 |
| (17) | 5,474,148 | 1.801 | 0.337 | 0.114 | 1.715 | 0.245 | 0.107 | 29.313 | 7.425 | 1.534 |
| (18) | 1,048,576 | 1.210 | 0.211 | 0.066 | 1.150 | 0.144 | 0.060 | 19.654 | 4.615 | 0.805 |
| (19) | 995,520 | 0.474 | 0.086 | 0.030 | 0.454 | 0.060 | 0.026 | 7.717 | 1.830 | 0.356 |
| (20) | 387,228 | 0.268 | 0.047 | 0.014 | 0.256 | 0.032 | 0.011 | 4.371 | 1.022 | 0.177 |
| (21) | 393,216 | 0.261 | 0.048 | 0.019 | 0.249 | 0.034 | 0.016 | 4.260 | 1.057 | 0.222 |
| (22) | 262,144 | 0.010 | 0.004 | 0.001 | 0.008 | 0.001 | 0.001 | 0.162 | 0.059 | 0.027 |
| (23) | 154,401 | 0.200 | 0.037 | 0.016 | 0.192 | 0.024 | 0.014 | 3.263 | 0.771 | 0.191 |
| (24) | 393,216 | 0.235 | 0.041 | 0.015 | 0.225 | 0.029 | 0.013 | 3.826 | 0.921 | 0.181 |
| (25) | 245,760 | 0.228 | 0.041 | 0.015 | 0.216 | 0.028 | 0.013 | 3.721 | 0.910 | 0.188 |
| (26) | 262,144 | 0.238 | 0.044 | 0.017 | 0.227 | 0.030 | 0.014 | 3.865 | 0.952 | 0.195 |
| (27) | 2,073,600 | 1.959 | 0.351 | 0.138 | 1.872 | 0.236 | 0.161 | 31.632 | 7.489 | 1.707 |
| (28) | 393,216 | 0.273 | 0.049 | 0.017 | 0.264 | 0.033 | 0.015 | 4.445 | 1.070 | 0.208 |
| (29) | 4,271,400 | 1.507 | 0.286 | 0.091 | 1.450 | 0.204 | 0.084 | 24.726 | 6.070 | 1.204 |
| (30) | 17,448,000 | 12.131 | 2.091 | 0.481 | 11.802 | 1.477 | 0.457 | 201.470 | 47.227 | 6.975 |
| (31) | 245,760 | 0.188 | 0.035 | 0.015 | 0.180 | 0.024 | 0.013 | 3.052 | 0.750 | 0.169 |
| (32) | 414,720 | 0.266 | 0.053 | 0.017 | 0.252 | 0.035 | 0.015 | 4.339 | 1.137 | 0.216 |
| Sum | 27.543 | 4.896 | 1.462 | 26.504 | 3.429 | 1.389 | 452.784 | 108.420 | 19.496 | |
| X | n | P1 | P2 | P3 | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| I-1 | I-2 | I-3 | I-1 | I-2 | I-3 | I-1 | I-2 | I-3 | ||
| (1) | 262,144 | 0.659 | 0.739 | 0.071 | 0.696 | 0.358 | 0.079 | 103.426 | 15.059 | 1.397 |
| (2) | 414,720 | 0.242 | 0.284 | 0.029 | 0.259 | 0.138 | 0.038 | 39.905 | 6.434 | 1.001 |
| (3) | 414,720 | 0.672 | 0.791 | 0.062 | 0.687 | 0.333 | 0.061 | 115.944 | 17.137 | 1.500 |
| (4) | 262,144 | 0.506 | 0.526 | 0.054 | 0.497 | 0.230 | 0.051 | 85.874 | 12.795 | 1.173 |
| (5) | 262,144 | 0.678 | 0.327 | 0.058 | 0.648 | 0.304 | 0.062 | 110.942 | 16.434 | 1.768 |
| (6) | 414,720 | 0.255 | 0.114 | 0.029 | 0.259 | 0.120 | 0.025 | 43.032 | 6.766 | 0.809 |
| (7) | 414,720 | 0.377 | 0.170 | 0.038 | 0.382 | 0.178 | 0.034 | 62.491 | 9.475 | 1.044 |
| (8) | 65,536 | 0.087 | 0.032 | 0.010 | 0.083 | 0.037 | 0.008 | 14.074 | 2.111 | 0.222 |
| (9) | 262,144 | 0.286 | 0.116 | 0.014 | 0.303 | 0.141 | 0.029 | 50.448 | 7.548 | 0.792 |
| (10) | 245,760 | 0.212 | 0.100 | 0.028 | 0.210 | 0.094 | 0.019 | 35.155 | 5.276 | 0.609 |
| (11) | 181,000 | 0.262 | 0.149 | 0.020 | 0.267 | 0.121 | 0.022 | 45.329 | 6.583 | 0.598 |
| (12) | 245,760 | 0.228 | 0.101 | 0.016 | 0.227 | 0.102 | 0.018 | 38.372 | 5.648 | 0.661 |
| (13) | 414,720 | 0.436 | 0.187 | 0.033 | 0.450 | 0.205 | 0.035 | 74.056 | 10.972 | 1.062 |
| (14) | 414,720 | 0.491 | 0.214 | 0.038 | 0.504 | 0.229 | 0.036 | 85.701 | 12.234 | 1.266 |
| (15) | 262,144 | 0.277 | 0.116 | 0.025 | 0.276 | 0.126 | 0.024 | 47.112 | 7.173 | 0.697 |
| (16) | 1,745,280 | 2.592 | 1.184 | 0.184 | 2.532 | 1.145 | 0.177 | 439.323 | 62.674 | 5.644 |
| (17) | 5,474,148 | 2.691 | 1.342 | 0.377 | 2.488 | 1.260 | 0.288 | 402.185 | 67.144 | 13.515 |
| (18) | 1,048,576 | 1.677 | 0.651 | 0.107 | 1.558 | 0.716 | 0.108 | 268.647 | 38.267 | 3.223 |
| (19) | 995,520 | 0.681 | 0.269 | 0.043 | 0.724 | 0.291 | 0.051 | 104.993 | 15.771 | 1.689 |
| (20) | 387,228 | 0.339 | 0.135 | 0.019 | 0.342 | 0.154 | 0.023 | 59.133 | 8.521 | 0.802 |
| (21) | 393,216 | 0.329 | 0.144 | 0.025 | 0.343 | 0.156 | 0.030 | 56.893 | 8.434 | 0.858 |
| (22) | 262,144 | 0.014 | 0.002 | 0.010 | 0.016 | 0.009 | 0.004 | 2.109 | 0.470 | 0.243 |
| (23) | 154,401 | 0.275 | 0.106 | 0.018 | 0.262 | 0.123 | 0.025 | 43.936 | 6.368 | 0.624 |
| (24) | 393,216 | 0.299 | 0.130 | 0.021 | 0.304 | 0.138 | 0.024 | 51.706 | 7.614 | 0.742 |
| (25) | 245,760 | 0.294 | 0.131 | 0.014 | 0.296 | 0.130 | 0.024 | 49.857 | 7.145 | 0.649 |
| (26) | 262,144 | 0.356 | 0.172 | 0.015 | 0.307 | 0.141 | 0.025 | 52.295 | 7.626 | 0.701 |
| (27) | 2,073,600 | 2.513 | 1.313 | 0.188 | 2.528 | 1.152 | 0.219 | 431.911 | 61.197 | 6.356 |
| (28) | 393,216 | 0.350 | 0.150 | 0.021 | 0.360 | 0.162 | 0.028 | 60.802 | 9.059 | 0.827 |
| (29) | 4,271,400 | 2.028 | 0.851 | 0.143 | 1.982 | 0.937 | 0.166 | 333.102 | 49.833 | 6.114 |
| (30) | 17,448,000 | 16.950 | 7.056 | 0.904 | 15.700 | 7.061 | 1.050 | 2733.081 | 386.570 | 33.050 |
| (31) | 245,760 | 0.241 | 0.127 | 0.019 | 0.247 | 0.113 | 0.024 | 41.698 | 6.001 | 0.624 |
| (32) | 414,720 | 0.333 | 0.381 | 0.020 | 0.345 | 0.164 | 0.029 | 58.023 | 8.572 | 0.872 |
| Sum | 37.630 | 18.110 | 2.653 | 36.082 | 16.568 | 2.836 | 6141.555 | 892.911 | 91.132 | |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).







