2

I'm dealing with some performance issues. When I have ImmutableJS map of ~40 elements, shown as checkboxes, when toggling a checkbox (via redux) dev tools throws me a violation info:

[Violation] 'click' handler took 231ms

Is this because I badly created a substate?

demongolem
  • 9,474
  • 36
  • 90
  • 105
Łukasz
  • 21
  • 3
  • Hello and welcome to StackOverflow. Please take some time to read the help page, especially the sections named ["What topics can I ask about here?"](http://stackoverflow.com/help/on-topic) and ["What types of questions should I avoid asking?"](http://stackoverflow.com/help/dont-ask). And more importantly, please read [the Stack Overflow question checklist](http://meta.stackexchange.com/q/156810/204922). You might also want to learn about [Minimal, Complete, and Verifiable Examples](http://stackoverflow.com/help/mcve). – Chris May 04 '17 at 14:53
  • It turned out that inside selector when filtering immutable map (40 elements) it takes about 100 ms, so probably I created a weak data structure. After rearranging substate into Map and list of selected items from this map I cut 100 ms. So now toggling state of map item last about 150ms, still too long. – Łukasz May 05 '17 at 11:54
  • Can you provide all of the code for a reproducible example? This seems very strange. – VanDanic May 05 '17 at 18:03
  • It was not the tech stack issue itself but poorly created wizard form component. On each step, I could have repeated list of a lot of checkboxes, and instead of mounting and unmounting page component I just visually hide them (with CSS). So right now after refactor I got ~50 ms of a click event instead of ~500. – Łukasz May 06 '17 at 12:57

0 Answers0