saltbot-org / saltbot

automated virtual betting bot
GNU General Public License v2.0
53 stars 45 forks source link

Firefox vs Chrome #515

Open kjb00415 opened 2 years ago

kjb00415 commented 2 years ago

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 commented 2 years ago

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:

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 commented 2 years ago

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 commented 2 years ago

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

reconman commented 2 years ago

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

calexil commented 1 year ago

I do, I'll get it added shortly

calexil commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

@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.