Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

[flagged]


Your comments reads in bad taste. Maybe be more constructive?


[flagged]


This is why we can’t have nice things.

To many times I’ve seen these kind of comments on GitHub, HN, ShowHN.

Our field is filled with people who lack a 101 in constructive feedback and context awareness and it breaks my heart. Who would like to ever contribute again if this was the response they got on their first contribution?


Still condescending if you ask me. Be constructive, his work is free and nobody forces you to use it. If your goal was to help the guy...you failed; "that had to be a challenge, but you did it".


Incredibly poor attitude. This is free, open source software. You did not pay for this. If you found a bug and you don't want to wait for the developer to fix it, then fix it and make a PR.

There is nothing wrong with making a post stating that you've found a bug. There is a problem with acting entitled like you are, and insulting the developer in the process.


>Incredibly poor attitude. This is free, open source software

so we're no longer allowed to criticize poor things we don't pay for?


There's a difference between "hey man you should check this with a throttled CPU" and "I hope developer of this component never makes a single webpage."


You hope they never make a single page? You can’t improve your skills as a developer? You started out brilliant?

This is a bad way to deliver criticism, especially on a ShowHN.


I fixed the issue, was unrelated with the component itself, can you please have a look again and verify that it works fine? https://zzarcon.github.io/react-circle/


Without knowing anything about the implementation, I'd guess this is not a case of using CPU/GPU a lot and causing a subsequent slowdown, but a case of a misplaced/misconfigured debounce function.


Can you please try it again? the issue was not related with the component itself https://zzarcon.github.io/react-circle

let me know if you still experience that issue


If you turn off animation it's snappy.

I'd recommend either killing that altogether as it definitely gives the perception of bad performance.

Or... at least take into account the delta of the progress change when doing animation. For instance, if going from 5 to 10%... a slower animation is fine. If going from 0 to 100%, the animation should be much quicker.


The performance is still bad. It's spending roughly 20ms doing JS work per frame.

React profiles are not very easy to interpret but perhaps you're doing a lot more work per frame than you should be?

Here's the profile: https://perfht.ml/2F7ohwx


This file is the entire source of the component: https://github.com/zzarcon/react-circle/blob/57bb4d19df08b73...

A lot of the work seems to be the React diffing? The only thing that changes between frames when dragging the slider is the style attribute.

Furthermore, the author seems to have included the development version of React. And the author used development settings for the webpack compilation. The compiled JS is full of eval() calls.


It might be slightly better, but still far from performance I would expect from that component

https://gfycat.com/TerribleWeeArmadillo


Is this Edge? I can confirm poor performance in Edge, but every other browse I've looked at seems to be ok.


That's Firefox on arch linux


Interesting... will have a deeper look into it, if you have any idea on how to make it better you are welcome


I actually work on low latency Java backends, I have no idea how this works ;)


> low latency Java

(Does not compute)


Sure it doesnt ;)

The think that myth is coming from the fact that JVM is heavy (150MB?), so it takes time to start, and hot-spot needs some iterations on a source code before it can fully apply JIT, but other that that, Java is really good.


Given there's only a single svg element changing I'm not exactly sure you could have done it better.

It might just be that the ease-out transitions for the stroke are not efficiently implemented in whatever browser you're using.

If you've tried and check out and understand the code you'd see there's so little being done in JS that this stuff is surely not the bottleneck.


Use a canvas and render the component directly? You’re rendering a circular progress bar, that should be easily doable in microseconds if not nanoseconds. There’s no need to use the overly bloated DOM for everything.

I suggest taking a look at Android’s views or even Flutter.


But there's only 3-4 DOM elements. I'm pretty sure doing this in canvas is not as trivial as this.


Of course it’s not as trivial. But you can control the animation much better, and you can have much better performance.


Yeah, more than likely the only problematic part is the transition animation. The main problem was another component breaking the performance in the examples page, not the component itself. Should be fixed now :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: