scala中iterable [string]与list [string]的用法

我正在阅读一个scala脚本,发现大量使用了iterable [string]。 例如

def wordFeatures(words: Iterable[String]): Iterable[Vector] = words.map(w => Try(word2vecModel.transform(w))).filter(_.isSuccess).map(_.get)

我是Scala的新手,我只会直接使用List [String],Array [String],Vector [String],集合,而不是Iterable [String],Iterable [Int]。

我想也许使用可迭代会减少内存使用和OOM的可能性,但不确定。

因此,问题是:在scala中传递可迭代对象而不是集合作为函数的参数有什么好处?