{"action":"created","issue":{"url":"https://api.github.com/repos/vazco/uniforms/issues/70","repository_url":"https://api.github.com/repos/vazco/uniforms","labels_url":"https://api.github.com/repos/vazco/uniforms/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/vazco/uniforms/issues/70/comments","events_url":"https://api.github.com/repos/vazco/uniforms/issues/70/events","html_url":"https://github.com/vazco/uniforms/issues/70","id":165560240,"number":70,"title":"Question: AutoForm performance?","user":{"login":"mdorn","id":81092,"avatar_url":"https://avatars.githubusercontent.com/u/81092?v=3","gravatar_id":"","url":"https://api.github.com/users/mdorn","html_url":"https://github.com/mdorn","followers_url":"https://api.github.com/users/mdorn/followers","following_url":"https://api.github.com/users/mdorn/following{/other_user}","gists_url":"https://api.github.com/users/mdorn/gists{/gist_id}","starred_url":"https://api.github.com/users/mdorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdorn/subscriptions","organizations_url":"https://api.github.com/users/mdorn/orgs","repos_url":"https://api.github.com/users/mdorn/repos","events_url":"https://api.github.com/users/mdorn/events{/privacy}","received_events_url":"https://api.github.com/users/mdorn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vazco/uniforms/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":{"login":"radekmie","id":1379064,"avatar_url":"https://avatars.githubusercontent.com/u/1379064?v=3","gravatar_id":"","url":"https://api.github.com/users/radekmie","html_url":"https://github.com/radekmie","followers_url":"https://api.github.com/users/radekmie/followers","following_url":"https://api.github.com/users/radekmie/following{/other_user}","gists_url":"https://api.github.com/users/radekmie/gists{/gist_id}","starred_url":"https://api.github.com/users/radekmie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radekmie/subscriptions","organizations_url":"https://api.github.com/users/radekmie/orgs","repos_url":"https://api.github.com/users/radekmie/repos","events_url":"https://api.github.com/users/radekmie/events{/privacy}","received_events_url":"https://api.github.com/users/radekmie/received_events","type":"User","site_admin":false},"assignees":[{"login":"radekmie","id":1379064,"avatar_url":"https://avatars.githubusercontent.com/u/1379064?v=3","gravatar_id":"","url":"https://api.github.com/users/radekmie","html_url":"https://github.com/radekmie","followers_url":"https://api.github.com/users/radekmie/followers","following_url":"https://api.github.com/users/radekmie/following{/other_user}","gists_url":"https://api.github.com/users/radekmie/gists{/gist_id}","starred_url":"https://api.github.com/users/radekmie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radekmie/subscriptions","organizations_url":"https://api.github.com/users/radekmie/orgs","repos_url":"https://api.github.com/users/radekmie/repos","events_url":"https://api.github.com/users/radekmie/events{/privacy}","received_events_url":"https://api.github.com/users/radekmie/received_events","type":"User","site_admin":false}],"milestone":null,"comments":15,"created_at":"2016-07-14T13:19:23Z","updated_at":"2016-07-18T19:31:49Z","closed_at":"2016-07-18T19:31:49Z","body":"I'm using `AutoForm` with minimal configuration on a Simple Schema that contains about 10 fields (mostly text fields, but one is an object that populates about 12 select boxes).  I'm using `AutoField` for all of them.  I've noticed that when I type in one of the text boxes, there's a very noticeable lag, and the CPU usage on my computer spikes significantly.\r\n\r\nAs I've experimented, I've noticed that any time there's more than 8 or 10 fields on the form, performance suffers badly.\r\n\r\nIs there anything that I can do to help this situation besides not using `AutoForm` ?\r\n\r\nI've actually cobbled together a simple test form that reproduces the problem: if I add 10 items to \"categories\" using the form below, typing into the \"name\" field becomes very slow and CPU-intensive:\r\n\r\n```javascript\r\nimport { SimpleSchema } from 'meteor/aldeed:simple-schema';\r\n\r\nimport _ from 'lodash';\r\nimport React from 'react';\r\nimport { AutoForm, ErrorsField, AutoField, SubmitField } from 'uniforms-unstyled';\r\n\r\nconst TestSchema = new SimpleSchema({\r\n  name: { type: String },\r\n  categories: { type: [String], defaultValue: [] },\r\n});\r\n\r\nexport const getForm = () => {\r\n  const fields = ['name', 'categories'];\r\n  const autoFields = _.map(fields, field => <AutoField name={field} key={field} />);\r\n  return (\r\n    <AutoForm\r\n      schema={TestSchema}\r\n      onSubmit={doc => (console.log(doc))}\r\n    >\r\n      <ErrorsField />\r\n      {autoFields}\r\n      <SubmitField />\r\n    </AutoForm>\r\n  );\r\n};\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/vazco/uniforms/issues/comments/233433431","html_url":"https://github.com/vazco/uniforms/issues/70#issuecomment-233433431","issue_url":"https://api.github.com/repos/vazco/uniforms/issues/70","id":233433431,"user":{"login":"radekmie","id":1379064,"avatar_url":"https://avatars.githubusercontent.com/u/1379064?v=3","gravatar_id":"","url":"https://api.github.com/users/radekmie","html_url":"https://github.com/radekmie","followers_url":"https://api.github.com/users/radekmie/followers","following_url":"https://api.github.com/users/radekmie/following{/other_user}","gists_url":"https://api.github.com/users/radekmie/gists{/gist_id}","starred_url":"https://api.github.com/users/radekmie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radekmie/subscriptions","organizations_url":"https://api.github.com/users/radekmie/orgs","repos_url":"https://api.github.com/users/radekmie/repos","events_url":"https://api.github.com/users/radekmie/events{/privacy}","received_events_url":"https://api.github.com/users/radekmie/received_events","type":"User","site_admin":false},"created_at":"2016-07-18T19:31:49Z","updated_at":"2016-07-18T19:31:49Z","body":"I've just released `1.0.0-rc.25`. It contains few bugfixes and enhancements, but the most important are optimizations. I've tried your schema, @serkandurusoy - it's immensely huge and it almost melted my computer while holding a single key in an input of generated form. Right now, after some work (and checking performance with `react-addons-perf`) it's okay. I've tried some heavy load (about 5 items in each array of that schema) and it was good. Now it's about ~200ms wasted during typing - it was ~6000ms (!).\r\n\r\nFurther optimizations are planned, but current version is good enough (for me of course) - now I want to close few more issues and **finally** release `1.0.0`.\r\n\r\n---\r\n\r\nI'll close this issue, as the main problem with CPU intensive forms is solved - don't worry, more optimizations are coming."}}
{"actor":{"display_login":"radekmie"}}