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

Firefox vs Chrome #515

Open
kjb00415 opened this issue Sep 30, 2022 · 8 comments
Open

Firefox vs Chrome #515

kjb00415 opened this issue Sep 30, 2022 · 8 comments

Comments

@kjb00415
Copy link

kjb00415 commented Sep 30, 2022

I understand that this extension is banned by chrome, however the performance difference between the two is remarkable. After some testing, the average bet timer with Firefox vs Chrome:
~100 match sample size for both:
Chrome - Bet locked in at: 33s remaining
Firefox - Bet locked in at: 3s remaining

Not sure if this is a browser performance issue between the two, or how Saltbot is using local storage between the 2 browsers, but Firefox is almost unplayable, unless you let it autobet for you.

Which leads to my next point. Why are we unable top export records in Firefox, and also not having a new dataset for almost two years?

Apologies if it sounds like i am complaining, but i guess you could call it some external QA. Any questions or criticisms are welcome.

@reconman
Copy link
Collaborator

Which leads to my next point. Why are we unable top export records in Firefox, and also not having a new dataset for almost two years?

Because the last feature was implemented in September 2019.

I haven't used Saltybet since the end of 2018. There are no active maintainers left, I only look at issues which are easy to fix. I have a few other projects, for example one with 50k+ users, which take up any time I want to invest into open source programming.

The only way someone will actually fix the performance issues is if a miracle happens and someone:

  • Is interested in saltybet
  • Knows how to write Browser extensions
  • Has experience with Data Science

Saltbot was slow to begin with when calculating chromosomes, since Browser Javascript doesn't support multi-threading well.

And like you said, I read about issues with huge amounts of recorded matches, but at this point, I don't want to invest anymore time rewriting Saltbot.

I thought a few times about starting over in another programming language for better performance and more efficient algorithms to find the best chromosome values. But then you can potentially break everything in the process, while giving me no benefits since I'm not a saltbot user anymore.

So to summarize, don't expect this issue to ever be fixed.

@kjb00415
Copy link
Author

Which leads to my next point. Why are we unable top export records in Firefox, and also not having a new dataset for almost two years?

Because the last feature was implemented in September 2019.

I haven't used Saltybet since the end of 2018. There are no active maintainers left, I only look at issues which are easy to fix. I have a few other projects, for example one with 50k+ users, which take up any time I want to invest into open source programming.

The only way someone will actually fix the performance issues is if a miracle happens and someone:

* Is interested in saltybet

* Knows how to write Browser extensions

* Has experience with Data Science

Saltbot was slow to begin with when calculating chromosomes, since Browser Javascript doesn't support multi-threading well.

And like you said, I read about issues with huge amounts of recorded matches, but at this point, I don't want to invest anymore time rewriting Saltbot.

I thought a few times about starting over in another programming language for better performance and more efficient algorithms to find the best chromosome values. But then you can potentially break everything in the process, while giving me no benefits since I'm not a saltbot user anymore.

So to summarize, don't expect this issue to ever be fixed.

Fair enough, thanks for the reply.

@kjb00415
Copy link
Author

kjb00415 commented Oct 3, 2022

@reconman Would it be possible for you to upload an up to date dataset?

@reconman
Copy link
Collaborator

reconman commented Oct 4, 2022

Since I haven't run saltbot in years, I don't have one.

@calexil
Copy link
Collaborator

calexil commented Nov 29, 2022

I do, I'll get it added shortly

@calexil
Copy link
Collaborator

calexil commented Nov 29, 2022

hmm, I can't seem to get my match data to export. keeps throwing an error:

Unchecked runtime.lastError: The message port closed before a response was received.

@ghost
Copy link

ghost commented Dec 9, 2022

I'm currently working on the massive hangups. It's going to take a while, as I'm going line by line until I have better performance while retaining the intended outputs.

I'm starting with the Simulator class present in popup.ts. So far it's running one generation per minute with 508k records present. It also makes Firefox completely unusable while SaltBot is actively processing bets.

Using the Firefox Add-on store (live) version to compare results from the changes, I have had the live version continually crash when attempting to make bets or generate new chromosomes.

I understand reconman's feelings about the project. This is a lot of work.

@reconman
Copy link
Collaborator

@omeganullptr Just some pointers on what I've looked at in the past:

There's the Web Workers API for running parallel tasks.

Calculating new chromosomes involves semi-randomly creating new chromosomes and then letting each of them bet on all recorded matches.

Right now this happens in a single thread and is either triggered if you click Update Chromosome or on a timer: https://github.com/saltbot-org/saltbot/blob/master/src/twitch_background.ts#L241

The timer one probably messes up betting for most users and could be removed.

Regarding multi-core calculation of chromosomes, the Web Worker API requires a Javascript file without any Chrome API usage like reading config or records. Therefore, the main script would have to send the record objects (25 MB) and the Chromosome to test to the Web Worker.

Since the code for testing Chromosomes uses most of the betting code, creating an isolated Web Worker script is pretty difficult. You can only test the impact of sending huge record data packages to the Web Workers after that.

I hoped that maybe WebAssembly could replace Web Workers, but I haven't found any implementation which could share data between the parallel threads.

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

No branches or pull requests

3 participants