{"action":"created","issue":{"url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/381","repository_url":"https://api.github.com/repos/offirgolan/ember-cp-validations","labels_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/381/labels{/name}","comments_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/381/comments","events_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/381/events","html_url":"https://github.com/offirgolan/ember-cp-validations/issues/381","id":186704861,"number":381,"title":"Validations slow performance","user":{"login":"jakesjews","id":481412,"avatar_url":"https://avatars.githubusercontent.com/u/481412?v=3","gravatar_id":"","url":"https://api.github.com/users/jakesjews","html_url":"https://github.com/jakesjews","followers_url":"https://api.github.com/users/jakesjews/followers","following_url":"https://api.github.com/users/jakesjews/following{/other_user}","gists_url":"https://api.github.com/users/jakesjews/gists{/gist_id}","starred_url":"https://api.github.com/users/jakesjews/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jakesjews/subscriptions","organizations_url":"https://api.github.com/users/jakesjews/orgs","repos_url":"https://api.github.com/users/jakesjews/repos","events_url":"https://api.github.com/users/jakesjews/events{/privacy}","received_events_url":"https://api.github.com/users/jakesjews/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-02T03:38:14Z","updated_at":"2016-11-02T12:03:22Z","closed_at":null,"body":"### Environment\r\n\r\n- Ember Version: 2.9\r\n- Ember CLI Version: 2.9\r\n- Ember CP Validations Version: Master\r\n\r\n### Steps to Reproduce\r\nI've been running into a lot of performance issue on a grid which can create many objects. I narrowed down the issue to slow performance in checking the isValid properties on each object. At first I assumed that I had some slow custom validators but after trimming them down to only use presence checks the issue still remained. Running the following test takes around 700ms on my laptop with only presence validations. This test was added to the suite on the master branch to make sure I didn't have anything in my code causing the issue.\r\n\r\n```\r\ntest('load test', function(assert) {\r\n  this.register('validator:presence', PresenceValidator);\r\n\r\n  let Validations = buildValidations({\r\n    a: validator('presence', true),\r\n    b: validator('presence', true),\r\n    c: validator('presence', true),\r\n    d: validator('presence', true),\r\n    e: validator('presence', true)\r\n  });\r\n\r\n  let Klass = Ember.Object.extend(Validations, {\r\n    a: null,\r\n    b: null,\r\n    c: null,\r\n    d: null,\r\n    e: null\r\n  });\r\n\r\n  let items = [];\r\n  for (let i = 0; i < 50; i++) {\r\n    let obj = setupObject(this, Klass, {\r\n      a: i,\r\n      b: i,\r\n      c: i,\r\n      d: i,\r\n      e: i\r\n    });\r\n    items.push(obj);\r\n  }\r\n\r\n  console.time('test');\r\n  Ember.A(items).mapBy('validations.isValid');\r\n  console.timeEnd('test');\r\n  assert.ok(true);\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/comments/257845678","html_url":"https://github.com/offirgolan/ember-cp-validations/issues/381#issuecomment-257845678","issue_url":"https://api.github.com/repos/offirgolan/ember-cp-validations/issues/381","id":257845678,"user":{"login":"offirgolan","id":575938,"avatar_url":"https://avatars.githubusercontent.com/u/575938?v=3","gravatar_id":"","url":"https://api.github.com/users/offirgolan","html_url":"https://github.com/offirgolan","followers_url":"https://api.github.com/users/offirgolan/followers","following_url":"https://api.github.com/users/offirgolan/following{/other_user}","gists_url":"https://api.github.com/users/offirgolan/gists{/gist_id}","starred_url":"https://api.github.com/users/offirgolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/offirgolan/subscriptions","organizations_url":"https://api.github.com/users/offirgolan/orgs","repos_url":"https://api.github.com/users/offirgolan/repos","events_url":"https://api.github.com/users/offirgolan/events{/privacy}","received_events_url":"https://api.github.com/users/offirgolan/received_events","type":"User","site_admin":false},"created_at":"2016-11-02T12:03:22Z","updated_at":"2016-11-02T12:03:22Z","body":"Also, 700ms for 50 objects seems a bit high. I'll try to investigate this further. @jakesjews can you also post you laptop specs.\r\n\r\ncc @stefanpenner "}}
{"actor":{"display_login":"offirgolan"}}