Here is a small test on the performance of Meteor 1.2.1.
performance.html
>
> performance
>
> <body>
> <br><br>
> <form class="search-form">
> <input type="text" name="keyword" placeholder="Enter a keyword to search">
> </form>
> <br>
> {{> items}}
> </body>
> <template name="items">
> <table>
> <thead></thead>
> <tbody>
> {{#each items}}
> <tr>
> <td>{{first}}</td>
> <td>{{second}}</td>
> <td>{{third}}</td>
> </tr>
> {{/each}}
> </tbody>
> </table>
> </template>
performance.js
> Items = new Mongo.Collection(āitemsā);
> if (Meteor.isClient) {
> Template.items.helpers({
> items: function () {
> if (Session.get('input')) {
> var keyword = Session.get('input');
> var regex = new RegExp(keyword, "i");
> return Items.find({$or: [{first: regex}, {second: regex}, {third: regex}]});
> } else {
> return Items.find();
> }
> }
> });
> Template.body.events({
> "submit .search-form": function (events) {
> events.preventDefault();
> var input = events.target.keyword.value;
> Session.set('input', input);
> }
> });
> }
> if (Meteor.isServer) {
> Meteor.startup(function () {
> // code to run on server at startup
> if (Items.find().count() < 5000) {
> for (var i = 1; i <= 5000; i++) {
> Items.insert({first: 'first_' + i, second: 'second_' + i, third: 'third_' + i, createdAt: new Date()});
> }
> }
> });
> }
When I load or refresh the page Chromeās developer tools shows it took about 3 seconds. And if I input, e.g., 1 and hit enter, then it looks like no response for a few seconds but will show the result at last.
Maybe some suggestion said donāt return all from collections, but really itās not a big data (5k docs, 3 simple fields) return, I also did the same thing by using Laravel 5 and MySQL, it works pretty smoothly, and I tried some query in Mongodb CLI also looks good, so whatās the problem on the performance of Meteor?