{"action":"created","issue":{"url":"https://api.github.com/repos/mongodb-js/log/issues/52","labels_url":"https://api.github.com/repos/mongodb-js/log/issues/52/labels{/name}","comments_url":"https://api.github.com/repos/mongodb-js/log/issues/52/comments","events_url":"https://api.github.com/repos/mongodb-js/log/issues/52/events","html_url":"https://github.com/mongodb-js/log/issues/52","id":83235095,"number":52,"title":"performance regression on current master version","user":{"login":"rueckstiess","id":99221,"avatar_url":"https://avatars.githubusercontent.com/u/99221?v=3","gravatar_id":"","url":"https://api.github.com/users/rueckstiess","html_url":"https://github.com/rueckstiess","followers_url":"https://api.github.com/users/rueckstiess/followers","following_url":"https://api.github.com/users/rueckstiess/following{/other_user}","gists_url":"https://api.github.com/users/rueckstiess/gists{/gist_id}","starred_url":"https://api.github.com/users/rueckstiess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rueckstiess/subscriptions","organizations_url":"https://api.github.com/users/rueckstiess/orgs","repos_url":"https://api.github.com/users/rueckstiess/repos","events_url":"https://api.github.com/users/rueckstiess/events{/privacy}","received_events_url":"https://api.github.com/users/rueckstiess/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-01T00:20:01Z","updated_at":"2015-07-19T22:44:21Z","closed_at":null,"body":"Did a comparison between current `dev` (old) and `master` (new) branch. master is ~ 20x slower than dev. Memory footprint also keeps growing. Need to check for memory leaks and why performance drop. Perhaps ampersand overhead?\r\n\r\nmtools parses 1000 log lines in ~30ms throughout.\r\nmongodb-log dev parses 1000 log lines initially in ~20ms, then grows to ~75ms.\r\nmongodb-log master parses 1000 log lines initially in ~450ms, then grows to ~1400ms.\r\n\r\n```js\r\nvar parse = require('mongodb-log');\r\nvar fs = require('fs');\r\nvar es = require('event-stream');\r\n\r\nvar records = 0;\r\nvar timer = new Date();\r\n\r\nfs.createReadStream('./support_1030.log')\r\n  .pipe(es.split('\\n'))\r\n  .pipe(parse())       // new version 'master'\r\n\r\n  // .pipe(es.map(function(data, cb) {        // previous version 'dev'\r\n  //   var parsed = parse.parse(data)[0];\r\n  //   cb(null, parsed);\r\n  // }))\r\n\r\n  .on('data', function(d) {\r\n    records++;\r\n    if (records % 1000 === 0) {\r\n      console.log(records, process.memoryUsage(), new Date() - timer, \"ms\");\r\n      timer = new Date();\r\n    }\r\n  })\r\n  .on('error', function(err) {\r\n    console.error(err);\r\n  })\r\n  .on('end', function() {\r\n    console.log(records);\r\n  });\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/mongodb-js/log/issues/comments/122712167","html_url":"https://github.com/mongodb-js/log/issues/52#issuecomment-122712167","issue_url":"https://api.github.com/repos/mongodb-js/log/issues/52","id":122712167,"user":{"login":"imlucas","id":23074,"avatar_url":"https://avatars.githubusercontent.com/u/23074?v=3","gravatar_id":"","url":"https://api.github.com/users/imlucas","html_url":"https://github.com/imlucas","followers_url":"https://api.github.com/users/imlucas/followers","following_url":"https://api.github.com/users/imlucas/following{/other_user}","gists_url":"https://api.github.com/users/imlucas/gists{/gist_id}","starred_url":"https://api.github.com/users/imlucas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imlucas/subscriptions","organizations_url":"https://api.github.com/users/imlucas/orgs","repos_url":"https://api.github.com/users/imlucas/repos","events_url":"https://api.github.com/users/imlucas/events{/privacy}","received_events_url":"https://api.github.com/users/imlucas/received_events","type":"User","site_admin":false},"created_at":"2015-07-19T22:44:21Z","updated_at":"2015-07-19T22:44:21Z","body":"@rueckstiess can you post a link to the log file you're using to bench?  Master currently does all kinds of stuff that is just there because things are still torn up from refactoring."}}