snowplow-incubator / common-streams

Other
1 stars 0 forks source link

Use `Vector` instead of `List` in transform methods #62

Closed pondzix closed 7 months ago

pondzix commented 7 months ago

Currently, the transform functions in common-loaders return a List. We construct the list by concatenating two lists: 1 for atomic fields and 1 for the self-describing entity fields (this line).

The ::: operator is relatively expensive, especially for large lists. And this is a “hot” function which we invoke for every single event.

If we switch the implementation to use Vector instead of List then it should be much more efficient to concatenate the two lists.