Immutable Arrays: Evaluating Copy-by-Change Methods
DOI:
https://doi.org/10.63282/3050-9416.IJAIBDCMS-V4I1P116Keywords:
Immutable Arrays, Copy-By-Change, Functional Programming, Memory Optimization, Data Structures, Concurrency, Performance AnalysisAbstract
In programming, immutability is now one of the key principles, which is in line with the general trend toward producing safer, more predictable, and concurrent-friendly code. Immutable arrays non-alterable data structuresare at the core of the concept of referential transparency and the prohibition of unintended side effects. Still, to be strictly immutable comes at a cost, especially when there is a need to update an array, hence the reason behind the writing of this paper that debates the performance of different copy-by-change methods. This paper assesses the effectiveness of such approaches, whereby changes in an immutable array are reflected in the newly created version that contains only the modified elements. First of all, the researchers want to know how the implementations of copy-by-change differently affect the performance, the amount of memory used, and also the scalability. Secondly, the researchers want to know the most reserving strategies for balancing immutability with computational efficiency. As to the methodology, the research is empirically performed by measuring the real costs of operations in different programming languages and the costs of the tests in real-world scenarios. The experiment results of journaling and benchmarking in Java, C#, and functional languages such as Haskell and Scala reveal that immutable arrays are less time and memory effective than their mutable counterparts; however, to a great extent, the penalty is softened by structural sharing, persistent data structures, and copy-on-write techniques. Moreover, the study points out that the compromise between immutability and performance depends on the case. Therefore, the copy-by-change method is a good choice when the main focus of an application is safety and concurrency rather than being fast. This research draws attention to the rise of immutability as the mainstay of designing systems that can scale and sets out avenues for enhancing operations on immutable arrays by mixing approaches and dispatching compiler-level tricks.
References
1. Perry, Michael L. "The art of immutable architecture." Apress: New York, NY, USA (2020).
2. Porat, Sara, et al. "Automatic detection of immutable fields in Java." Proceedings of the 2000 conference of the Centre for Advanced Studies on Collaborative research. 2000.
3. Macko, Peter, et al. "Llama: Efficient graph analytics using large multiversioned arrays." 2015 IEEE 31st International Conference on Data Engineering. IEEE, 2015.
4. Parakala, Adityamallikarjunkumar. "Integrating Salesforce and UiPath: Cross-System Intelligent Automation." International Journal of Emerging Trends in Computer Science and Information Technology 3.4 (2022): 88-99.
5. Chen, Rong, et al. "Computation and communication efficient graph processing with distributed immutable view." Proceedings of the 23rd international symposium on High-performance parallel and distributed computing. 2014.
6. Chakravarty, Manuel MT, and Gabriele Keller. "An approach to fast arrays in Haskell." International School on Advanced Functional Programming. Berlin, Heidelberg: Springer Berlin Heidelberg, 2002. 27-58.
7. van Merrienboer, Bart, Dan Moldovan, and Alexander Wiltschko. "Tangent: Automatic differentiation using source-code transformation for dynamically typed array programming." Advances in Neural Information Processing Systems 31 (2018).
8. Haack, Christian, and Erik Poll. "Type-based object immutability with flexible initialization." European Conference on Object-Oriented Programming. Berlin, Heidelberg: Springer Berlin Heidelberg, 2009.
9. Patton, Michael Quinn. Qualitative evaluation methods. Vol. 381. Beverly Hills, CA: Sage publications, 1980.
10. Bennett, Judith. "Evaluation methods in research." (2003): 1-118.
11. Edwards, Paula J., et al. "Methods of evaluating outcomes." Handbook of human factors and ergonomics (2012): 1139-1175.
12. Blanc, Régis, et al. "An overview of the Leon verification system: Verification by translation to recursive functions." Proceedings of the 4th Workshop on Scala. 2013.
13. Guntupalli, Bhavitha. "Unit Testing in ETL Workflows: Why It Matters and How to Do It." International Journal of Artificial Intelligence, Data Science, and Machine Learning 2.4 (2021): 38-50.
14. Vekris, Panagiotis, Benjamin Cosman, and Ranjit Jhala. "Refinement types for TypeScript." Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation. 2016.
15. Czajkowski, Grzegorz. "Application isolation in the Java virtual machine." ACM Sigplan Notices 35.10 (2000): 354-366.
16. Parakala, Adityamallikarjunkumar. "Role Evolution: Developer, Analyst, Lead, Senior." American International Journal of Computer Science and Technology 4.3 (2022): 11-19.
17. Wylie, C. C., D. Stott, and P. J. Donovan. "Primordial germ cell migration." The Cellular Basis of Morphogenesis (1986): 433-448.
18. O'NEILL, MELISSA E., and F. Warren Burton. "A new method for functional arrays." Journal of functional programming 7.5 (1997): 487-513.
19. Vemula, V. R., & Yarraguntla, T. (2021). Mitigating insider threats through behavioural analytics and cybersecurity policies. Int. Meridian J, 3(3), 1-20.