You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
I've read in any post that the use of string concatenation performs a
malloc each time.
And like strings are immutable, modifying them wih "+" or "+=" is a
timeconsuming and expensive process.
So would be better to consider using fmt.Fprintf/Sprintf to format the
string (except for a single concatenation somewhere in the code). Is
right?
Evan Shaw
unread,
Sep 30, 2010, 11:04:19 AM9/30/10
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Archos, golang-nuts
On Thu, Sep 30, 2010 at 10:00 AM, Archos <raul...@sent.com> wrote: > I've read in any post that the use of string concatenation performs a > malloc each time.
This used to be true, but changed fairly recently due to a compiler/runtime optimization. Now s1 + s2 + s3 compiles to a single runtime.concatstring call, which allocates only once.