Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any reason to use $map in this module vs the result? #7

Open
christianbundy opened this issue Apr 21, 2020 · 2 comments
Open

Comments

@christianbundy
Copy link

I feel pretty comfortable with mapping with pull-streams, but I noticed that this module provides the same functionality. Is it any faster to use $map or should I just do it in my pull-stream?

@dominictarr
Copy link
Owner

I don't know you should measure it!

But theoretically, there are two reasons you'd use $map here, 1) you have MFR running on the server, so maybe you want to do the map there instead of the client, or 2) because to prepare the data for the $reduce step. it's probably a bit faster to make the map pure js, rather than basically an interpreted mini language. on the other hand, using map may save you serialization/deserialization by sending less data.

@christianbundy
Copy link
Author

True! Those are good points, thanks for helping me understand this a bit better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants