Difficulty determining the size of an Erlang binary

I know that for a list, we need to go through the entire list and then determine its size?

What is the difficulty in determining the size of a binary file in Erlang?

+3


source to share


2 answers


byte_size (command to measure a binary file) runs in constant time, not related to the size of the binary file, and the length of the list is proportional to the size of the list.



Link

+2


source


Time and complexity of the memory erlang:size/1

, erlang:tuple_size/1

, erlang:bit_size/1

and erlang:byte_size/1

equal to O (1). (And erlang:map_size/1

.) Why do you even think it might be something else? It doesn't make any sense.



+5


source







All Articles