Journals / Türk Doğa ve Fen Dergisi / 2026 / Sayı: 1 Özel Sayı

Performance Analysis of Span Data Type in C# Programming Language

Hakan Akdoğan(Özdilek Ev Tekstil Sanayi ve Ticaret A.Ş)0009-0000-5067-268X
Halil İbrahim Duymaz(Özdilek Ev Tekstil Sanayi ve Ticaret A.Ş)0009-0005-8406-8831
Nadir Kocakır(Özdilek Ev Tekstil Sanayi ve Ticaret A.Ş)0000-0001-7421-0631
Önder Karademir(Özdilek Ev Tekstil Sanayi ve Ticaret A.Ş)0000-0001-5757-7335
Pages
29–36
Publication Date
2024-10-01
🏛️Bibliographic metadata and full text access for this article are provided via DergiPark.
DergiPark Record ↗
✨

AI Summary & Key Takeaways

AI Insight
⚡ TL;DR(Too Long; Didn't Read)

The Span data type may be a more effective option, especially in data processing and performance-sensitive applications.

📌 3 Key Takeaways

🎯
Objective & Hypothesis:This study presents a comparative analysis of the Span data type in the C# programming language against other data types.
📊
Key Findings & Data:Span is a data type supported in .NET Core 2.1 and later versions, and this research investigates its impact on method performance and memory usage.
💡
Conclusion & Impact:The Span data type may be a more effective option, especially in data processing and performance-sensitive applications.
🔬Design:Araştırma Makalesi
📍Scope:Comprehensive Sample
⚙️Variables:Span Data Type · Performance Analysis · .NET Core

Abstract

This study presents a comparative analysis of the Span data type in the C# programming language against other data types. Span is a data type supported in .NET Core 2.1 and later versions, and this research investigates its impact on method performance and memory usage. The primary objective of the study is to highlight the potential advantages of the Span data type for C# developers. In pursuit of this goal, the study examines the performance effects of the Span data type through comparative analyses using various methods. For instance, when comparing the StringReplace and SpanReplace methods over 1000 iterations, it is observed that SpanReplace is significantly faster. Similarly, analyses conducted on methods like Contains used in data types such as Queue, List, and Stack demonstrate the performance advantages of the Span data type. In scenarios where the Span data type is employed, it is determined that memory consumption is lower compared to other data types. These findings can assist C# programmers in understanding the potential of the Span data type and optimizing their code accordingly. The Span data type may be a more effective option, especially in data processing and performance-sensitive applications.

🔖

Cite This Article

Akdoğan, H., Duymaz, H. İ., Kocakır, N., Karademir, Ö. (2024). Performance Analysis of Span Data Type in C# Programming Language. Türk Doğa ve Fen Dergisi, Sayı: 1 Özel Sayı, 29–36. https://doi.org/10.46810/tdfd.1425662

📄 Full Text PDF Viewer

📄

PDF görüntüleyici hazırlanıyor...

References (17)

  1. Deshmukh R, Li R, Sen RR, Henry M, Beckwith G, Gupta G. Performance characterization of.NET benchmarks. IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS); 2021 Apr. Stony Brook, NY, USA. p. 107-17. doi: 10.1109/ISPASS51385.2021.00028.
  2. Almada A. Performance of value-type vs. reference-type enumerators in C# [Internet]. 2023 Jul 22 [cited 2023 Jul 22]. Available from: https://www.linkedin.com/pulse/performance-value-type-vs-reference-type-enumerators-ant%C3%A3o-almada/
  3. Usman M, Bajwa Z, Afzal M. Performance analysis of searching algorithms in C#. International Journal for Research in Applied Science & Engineering Technology (IJRASET). 2014;2(4):511-3.
  4. Shastri S, Singh A, Mohan B, Mansotra V. Run-time analysis of searching and hashing algorithms with C# [Internet]. 2016 Dec [cited 2016 Dec]. Available from: https://www.researchgate.net/publication/311541937_Run-Time_Analysis_of_Searching_and_Hashing_Algorithms_with_C#
  5. Arif MA, Hossain MS, Nahar N, Khatun MD. An empirical analysis of C#, PHP, JAVA, JSP and ASP.Net regarding performance analysis based on CPU utilization. Banglavision Research Journal. 2014;14(1):174-88.
  6. Sestoft P. Numeric performance in C, C# and Java [Internet]. 2007 Feb 28 [cited 2007 Feb 28]. Available from: https://www.researchgate.net/publication/228380860_Numeric_performance_in_C_C_and_Java
  7. The Tech Platform. Why and how string is immutable in C# [Internet]. 2021 Oct [cited 2021 Oct]. Available from: https://www.thetechplatform.com/post/why-and-how-string-is-immutable-in-c
  8. Wickramarathna N. An introduction to writing high-performance C# using Span struct [Internet]. 2021 Dec [cited 2021 Dec]. Available from: https://nishanc.medium.com/an-introduction-to-writing-high-performance-c-using-span-t-struct-b859862a84e4
  9. BenchmarkDotNet. BenchmarkDotNet: Powerful.NET library for benchmarking [Internet]. 2024 Jan [cited 2024 Jan]. Available from: https://github.com/dotnet/BenchmarkDotNet
  10. CodeAcademy. Contains() [Internet]. 2023 Apr [cited 2023 Apr]. Available from: https://www.codecademy.com/resources/docs/c-sharp/strings/contains
  11. Tripathi P. Binary search using C# [Internet]. 2023 Nov [cited 2023 Nov]. Available from: https://www.c-sharpcorner.com/blogs/binary-search-implementation-using-c-sharp1
  12. Microsoft. ArraySegment.Slice Method [Internet]. 2024 Jan [cited 2024 Jan]. Available from: https://learn.microsoft.com/en-us/dotnet/api/system.arraysegment-1.slice?view=net-8.0
  13. Geeks for Geeks. C# | Replace() method [Internet]. 2019 May [cited 2019 May]. Available from: https://www.geeksforgeeks.org/c-sharp-replace-method/
  14. Microsoft. String.StartsWith Method [Internet]. 2024 Jan [cited 2024 Jan]. Available from: https://learn.microsoft.com/en-us/dotnet/api/system.string.startswith?view=net-8.0
  15. Deshmukh R, Li R, Sen RR, Henry M, Beckwith G, Gupta G. Performance characterization of.NET benchmarks. IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS); 2021 Apr. Stony Brook, NY, USA. p. 107-17. doi: 10.1109/ISPASS51385.2021.00028.
  16. BenchmarkDotNet. BenchmarkDotNet: Powerful.NET library for benchmarking [Internet]. 2024 Jan [cited 2024 Jan]. Available from: https://github.com/dotnet/BenchmarkDotNet
  17. Microsoft. ArraySegment.Slice Method [Internet]. 2024 Jan [cited 2024 Jan]. Available from: https://learn.microsoft.com/en-us/dotnet/api/system.arraysegment-1.slice?view=net-8.0