[erlang-questions] Performance of type_to_type functions

Mikael Pettersson <>
Thu Sep 22 21:51:24 CEST 2016


月忧茗 writes:
 > integer_to_list
 > > integer_to_binary
 > > atom_to_binary
 > > ...
 > 
 > 
 > how about the performance of this type to type function?
 > can I using this function wildly?

You can, but you shouldn't because they need to allocate and initialize memory
in order to produce the alternative value representation you're asking for
(say, from the integer 55 to the list [$5, $5]).  And that's in addition to
whatever type checking they have to perform first.

So no they're not "free".


More information about the erlang-questions mailing list