Created
May 14, 2018 22:43
-
-
Save veered/931624389163916ded3a4f5617b558d1 to your computer and use it in GitHub Desktop.
Reproduce _.isEmpty slowness
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
import { Meteor } from 'meteor/meteor'; | |
import { Mongo } from 'meteor/mongo'; | |
Widgets = new Mongo.Collection('widgets'); | |
if (Widgets.find().count() < 1000) { | |
for (let i=0; i < 1000; i++) { | |
Widgets.insert({}); | |
} | |
} | |
let handles = []; | |
for (let i=0; i<5000; i++) { | |
handles.push(Widgets.find({ i }).observe({ added(){}, changed(){}, removed(){} })); | |
} | |
import Profile from 'meteor/qualia:profile'; | |
Profile.profileDuration('zprofile', '/Users/lucas/Downloads/zprofile.cpuprofile', 5000); | |
handles.forEach(handle => handle.stop()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment