If you disassemble your code myRdd.map{x => "some_text" + x._1 + "some_other_text" + x._4 + ...}, it would show something like this:
NEW java/lang/StringBuilder
DUP
LDC 24
INVOKESPECIAL java/lang/StringBuilder.<init> (I)V
LDC "some_text"
INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
ALOAD 0
INVOKEVIRTUAL scala/Tuple2._1 ()Ljava/lang/Object;
INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
LDC "some_other_text"
INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/String;)Ljava/lang/StringBuilder;
ALOAD 0
INVOKEVIRTUAL scala/Tuple2._2 ()Ljava/lang/Object;
INVOKEVIRTUAL java/lang/StringBuilder.append (Ljava/lang/Object;)Ljava/lang/StringBuilder;
INVOKEVIRTUAL java/lang/StringBuilder.toString ()Ljava/lang/String;
So as you can see, scala compiler optimizes string concatenations to use StringBuilder and there is not really a difference between your first code snippet and second (Javac also does that). The first solution is preferable (especially version with string interpolation) because it's more readable.
You could reuse your string builder by resetting it using setLength method.
val sb = new StringBuilder()
myRdd.map{x =>
sb.setLength(0)
sb.append("some_text" + x._1 + "some_other_text" + x._2)
sb.toString
}
But I don't know if it's worth it. String builders created in this loop won't leave eden memory region and will be immediately cleaned out by GC.
The downside of using an approach with StringBuilder is, it is a lot less readable, not functional and ugly. If you don't have serious problems with performance caused by this fragment I would stay with string interpolation. Remember Premature optimization is a root of all evil.