Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wishlist: ability to disable the synthetic event system #1269

Closed
jaredly opened this issue Mar 19, 2014 · 15 comments
Closed

Wishlist: ability to disable the synthetic event system #1269

jaredly opened this issue Mar 19, 2014 · 15 comments

Comments

@jaredly
Copy link
Contributor

jaredly commented Mar 19, 2014

Would there be huge problems caused by optionally disabling the synthetic event system? I'd like the option to do so in order to get more responsiveness out of underpowered machines.

@sophiebits
Copy link
Collaborator

Not quite sure what you mean. If you don't attach any events to your elements then there shouldn't be any overhead from the events system.

@jordwalke
Copy link
Contributor

@jaredly, are you seeing issues? The Synthetic event system may actually help you get responsiveness out of underpowered machines. Attaching event listeners to actual DOM nodes is expensive.

@jaredly
Copy link
Contributor Author

jaredly commented Mar 19, 2014

Yeah, I'm seeing a lag with my <input>s. I know I can just hack around it with componentDidMount, but I wondered if it would be possible to just switch to native event handling.

@sophiebits
Copy link
Collaborator

@jaredly You're seeing lag that goes away when you use native event handling? I'd be interested in seeing a test case that shows that.

@jaredly
Copy link
Contributor Author

jaredly commented Mar 19, 2014

step 1) use a really underpowered netbook :)
yeah, I'll put together a test page

@jaredly
Copy link
Contributor Author

jaredly commented Mar 19, 2014

The problem is probably exacerbated by the "keydown -> change state -> re-render -> update dom" loop for bound input elements.

@jordwalke
Copy link
Contributor

Is this just an input related problem? Or do you see issues with click handlers (I suspect you don't)?

@jaredly
Copy link
Contributor Author

jaredly commented Mar 19, 2014

I've only noticed it on the inputs

@jaredly
Copy link
Contributor Author

jaredly commented Mar 19, 2014

I don't have any onMouseMove handlers at the moment, but I wouldn't be surprised if it had issues as well

@jaredly
Copy link
Contributor Author

jaredly commented Mar 19, 2014

click handlers don't generate enough events to bottleneck

@plievone
Copy link
Contributor

@jaredly There is also an issue #1178 on inputs.

@syranide
Copy link
Contributor

@jaredly It sounds like your problem is large parts or the entire app re-rendering (without any shouldComponentUpdate) and it's simply too costly and ends up slowing down the input.

@jaredly
Copy link
Contributor Author

jaredly commented May 18, 2014

That's what I thought, but having a single input on a page with nothing
else and it was noticeably laggy as compared with a non react input (on my
rather underpowered netbook)
On May 18, 2014 9:02 AM, "Andreas Svensson" notifications@github.com
wrote:

@jaredly https://github.com/jaredly It sounds like your problem is
large parts or the entire app re-rendering (without any
shouldComponentUpdate) and it's simply too costly and ends up slowing down
the input.


Reply to this email directly or view it on GitHubhttps://github.com//issues/1269#issuecomment-43443595
.

@sophiebits
Copy link
Collaborator

No plans to do this.

@tusharmath
Copy link

I am trying to build a side nav that can be dragged in from the left. I listen to the touchmove event on the screen and as the thumb slides right I keep calculating translateX and push it to the state, which can be then used to render the sidenav. The problem that I have is —

The touchmove event is fired at a very high speed, though I throttle these events using requestAnimationFrame while calculating translateX, these synthetic events that even though are not being consumed take up valuable ms from the frame.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants