[erlang-questions] timing ++ operation

Jachym Holecek freza@REDACTED
Sat Apr 9 11:30:14 CEST 2011


# Wes James 2011-04-09:
> [...] 
>
> I then run this to create a test erl file which has a 10000 long
> A="a1" ++ "a2" ..... "a10000":
>
> [...]
>
> I then c(plus) and then plus:s(). and the process time and
> microseconds are 0.  Is that because the string of ++ items is compile
> in to one big string and all the operation does is assign it to A?

Yes. BTW 'erlc +to_asm foo.erl' is very useful for discovering what gets
compiled to what.

Regards,
	-- Jachym



More information about the erlang-questions mailing list