c# - Resizing array performance? -


i'm wondering if resizing byte arrays can take big hit on performance. i'm adding data class , if class contains data type need add existing byte array, means i'll need resize it. problem there data types have adding in bulk means there multiple array resizes occurring.

would make huge impact on performance? class can performance critical.

if does, might have design-overhaul.

if resizing required should use list<byte> instead. arrays cannot resized have create new array , copy old content new array before adding additional content (this array.resize if that's referring to).

list<t> using array internally optimize resizing don't have deal it.

essentially once internal array full , new content added, list<t> double internal array size, hence resizing should in fact occur - if resize array directly on other hand either have employ similar strategy , keep "size counter" or take resize performance cost on content addition.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -