-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[proposal] provide benchmarks for the claims in changelog 3.16.0 and against other state managements #789
Comments
Here are some other benchmarks https://github.com/jonataslaw/flutter_state_managers |
Hi @iapicca As for the performance of GetX and Bloc, you can run the application from this repository and check with the dart inspect tools. There are tests performed by other users, like https://twitter.com/r_FlutterDev/status/1274146807073902599 there were also prints about the tests from the above repository, but I removed any reference to the names of other packages from the readme, because I don't see this as a product rivalry as people are putting it, even because you can use GetX in conjunction with other tools, other state managers, other dependency injectors, etc. As for the first claim that Google and product managers use GetX, I never said that, and that claim doesn't make any sense, and I believe they should check the authenticity of it, because it's a really serious accusation about me about a fact that never happened , and well, besides being a programmer i am a lawyer and this type of slander is a crime against image. I would really like the Google team to analyze the package, both the performance issues (which, however trivial and manual, are not surprising), as well as the veracity of the source of this claim. If necessary, I can link my social media to check the comments, because if there was any comment in that sense, it is fake. |
thanks for the answer, what about the claims in the changelog? |
Hi, you're welcome. |
you compare apples to pears. If you create a Stream with synchronous=true, the Dart Stream is faster than your implementation. Because then it's operates like your implementation. |
Value also checks whether the value has been changed. |
Well, I'm honestly tired of it. I just received an email threatened by GetX, and I never thought I could get through it. |
For future reference only: Dart also has a Synchronous Streams api that has very low latency, however, it is not suitable for use in state management for two reasons: void main() {
var controller = StreamController.broadcast(sync: true);
var stream = controller.stream;
stream.listen((data) {
print('$data');
if (data == 'test4') controller.add('test5');
});
print('test1');
controller.add('test2');
stream.listen((event) {}); // second listen throws a exception
print('test3');
controller.add('test4');
print('test6');
controller.add('test7');
print("test8");
} 2- Even with a single listener, the dart's Synchronous Streams api cannot deliver events in the exact order. We plan to work on a PR in the future at dart-lang to address this. So if we remove the line above that causes the exception, we will have the following output in the log: void main() {
var controller = StreamController(sync: true);
var stream = controller.stream;
stream.listen((data) {
print('$data');
if (data == 'test4') controller.add('test5');
});
print('test1');
controller.add('test2');
// stream.listen((event) {}); // second listen throws a exception
print('test3');
controller.add('test4');
print('test6');
controller.add('test7');
print("test8");
}
///////////////////// log:
test1
test2
test3
test4
test6
test8
test5
As we can see, test 4 skips to test 6, which skips to test 8, which skips to test 5. Note that test 7 didn't even appear in the log. However, if we work with GetStream, everything works as expected: void main() {
var controller = GetStream();
var stream = controller.stream;
stream.listen((data) {
print('$data');
if (data == 'test4') controller.add('test5');
});
print('test1');
controller.add('test2');
// stream.listen((event) {}); // second listen throws a exception
print('test3');
controller.add('test4');
print('test6');
controller.add('test7');
print("test8");
}
///////////////////// log:
test1
test2
test3
test4
test5
test6
test7
test8
The dart documentation is clear that this api should be used with caution, and in view of these tests, we were sure that it is not stable enough to be used as the core of our state management, nor of the websockets notifications and get_server requests. Clarification about the controversy over benchmarks: In short: asynchronous streams from dart work perfectly, but add a latency that we want to remove on Get_server. I want to apologize if I caused turbulence in the community, and I hope that from today our community will be more united, without discussions about Getx, Provider, Bloc, Get_it_mixin, Mobx is better, without people denigrating each other's work, without people with a tone of superiority. And I wanted to ask for respect in discussions by everyone in the community, including GetX users. |
I noticed these 2 conflicting PR's pro and against adding getX to the list state management options
I find the allegations in the against issue quite concerning
I've seen often on social media
claims about
GetX
being faster than Bloc, MobX and so onand if this seems to be the only benchmark available at the moment
could you provide a benchmark against the aforementioned state managemets?
in you changelog you claim
could you provide a benchmark that backs these claims?
thank you
The text was updated successfully, but these errors were encountered: