You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When accessing a collections by numeric index, Vector has much better performance than List, effective constant time vs linear for List [http://docs.scala-lang.org/overviews/collections/performance-characteristics.html]. Indexed access is very common for CSV data.
It is unfortunate that CSVParser currently uses a Vector internally, but then converts to a less-optimal List before returning to client.
It would be easy to support parsing to Vector by introducing a parseVectormethod that doesnt convert to List, and then calling that from a parsemethod returning List, to maintain compatiblity.
Happy to send a PR if you are open to this idea?
The text was updated successfully, but these errors were encountered:
I think this is not so important from the point of view of performance, because the list of fields are not so long.
However, it was a big mistake to use List[String] as the type of interface. It has no reason to be List[String]. I will change it to Seq[String] and use Vector as implementation in the future.
When accessing a collections by numeric index,
Vector
has much better performance thanList
, effective constant time vs linear for List [http://docs.scala-lang.org/overviews/collections/performance-characteristics.html]. Indexed access is very common for CSV data.It is unfortunate that CSVParser currently uses a Vector internally, but then converts to a less-optimal List before returning to client.
It would be easy to support parsing to Vector by introducing a
parseVector
method that doesnt convert to List, and then calling that from aparse
method returningList
, to maintain compatiblity.Happy to send a PR if you are open to this idea?
The text was updated successfully, but these errors were encountered: