When used Array.GetLength(dimension)in C #, is the size of the array actually calculated every time it is called, or is it a cached / saved size and just what access does it matter?
Array.GetLength(dimension)
What I really want to know is that if a local variable in the length of the array dimension adds any efficiency, if it is used in a large loop, or if I can just call array.GetLength () again and again w / o any speed limit.
It is definitely a bad idea to start caching / optimizing yourself.
, (JIT). , , , .
, .
(int[][]) , (int[,]). int[,] . Fx2, , Fx4.
int[][]
int[,]
, hoisting ' Length.
, , . , , , , 30% .
, , GetLength . , .
GetLength
. Length , .
Length
, , . . , ?
. , - , !
- . "" (, Array.Length) .net , "Count" (, List.Count) / . ( .nets , Any, , , Count). GetLength Length , , .
- GetLength - - foreach, .
( ( ), , / . , , )
Source: https://habr.com/ru/post/1753080/More articles:Rails Routes and Site Performance - ruby-on-railshttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1753076/how-to-add-google-analytics-to-restructuredtext&usg=ALkJrhi5jfZnMUsmkaZeQtChWsiTwgdSpQПоддерживать проекты C в Visual Studio 2010? - cEclipse: how to ignore .git subdir when adding one project to another project build path? - gitHow to remove old content from jquery-ui tabs when clicked? - jqueryWhat is a good general open source IDE that is written for Windows? - ruby | fooobar.comSQL - duplicate search in two columns - sqlhow to make delete / put request in python - pythonMultiple Django Table Inheritance and Model Creation - djangosubdomain name validation in javascript / jquery - javascriptAll Articles