-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
Vector
instead of List
in transform methods.
Currently, the transform functions in common-loaders return a [List](https://github.com/snowplow-incubator/common-streams/blob/0.2.1/modules/loaders-common/src/main/scala/com/snowplowanalytics/snowplow/loaders/transform/Transform.scala#L83). We construct the list by concatenating two lists: 1 for atomic fields and 1 for the self-describing entity fields ([this line](https://github.com/snowplow-incubator/common-streams/blob/0.2.1/modules/loaders-common/src/main/scala/com/snowplowanalytics/snowplow/loaders/transform/Transform.scala#L86)). 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.
- Loading branch information
Showing
2 changed files
with
15 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters