C
C#10mo ago
Saintz

How to make this Faster?

Does someone know how to make this faster i would appreciate any help
30 Replies
Angius
Angius10mo ago
That's a lot of dynamic and object Wouldn't surprise me if it was dynamic that was, at least partially, responsible for any performance issues you might be having
Saintz
SaintzOP10mo ago
you have any fixes/corrections in this code? or should i use var?
Angius
Angius10mo ago
var and dynamic are two completely different and unrelated things var is type inference, but still provides strict and static typing dynamic generates the type on runtime, hence the performance cost And object is the equivalent of "anything lmao"
mtreit
mtreit10mo ago
Why do you have an async lambda that does no awaits inside of it? Why do you have a maxThreads variable that isn't used? Is your catch block that catches all exceptions running? Exceptions are very slow so if that's happening that would be hurting performance.
Saintz
SaintzOP10mo ago
so i could understand a bit of it do you know what i should change all and what fixes i could do for that? to make it run more smooth / perfomance whise
mtreit
mtreit10mo ago
Why are you spinning up 250 tasks that all execute the exact same call?
Saintz
SaintzOP10mo ago
i am doing a method which requires to do alot of requests since it gain with that the amount (more likely an exploit) so i need to use this but i want to make it all faster and i dont see what i should change at all to make it run faster
mtreit
mtreit10mo ago
exploit?
Saintz
SaintzOP10mo ago
yes
Jimmacle
Jimmacle10mo ago
as someone who can't access the discord CDN at work i wish people would use the paste site
Saintz
SaintzOP10mo ago
i could paste it but it has to many messages List<Task> tasks = new List<Task>(); int maxThreads = 200; for (int m = 0; m < 250; m++) { Task task = Task.Run(async () => { try { object obj = AMF.SendAMF("MovieStarPlanet.WebService.Bonster.AMFBonsterService.WashBonster", new object[4] { new TicketHeader { Ticket = TicketGenerator.headerTicket(loginResponse["loginStatus"]["ticket"]) }, Convert.ToInt32(ActorBonsterRelId), 100, loginResponse["loginStatus"]["actor"]["ActorId"] },proxy); if (((dynamic)obj)["level"] != 0) { Console.WriteLine("SENT REQUEST LEVEL: " + ((dynamic)obj)["level"]); } } catch { AMF.SendAMF("MovieStarPlanet.WebService.Bonster.AMFBonsterService.WashBonster", new object[4] { new TicketHeader { Ticket = TicketGenerator.headerTicket(loginResponse["loginStatus"]["ticket"]) }, Convert.ToInt32(ActorBonsterRelId), 100, loginResponse["loginStatus"]["actor"]["ActorId"] },proxy); } }); tasks.Add(task); } await Task.WhenAll(tasks); }
Jimmacle
Jimmacle10mo ago
i mean $paste
MODiX
MODiX10mo ago
If your code is too long, you can post to https://paste.mod.gg/ and copy the link into chat for others to see your shared code!
Saintz
SaintzOP10mo ago
ohh i see
mtreit
mtreit10mo ago
What do you mean by exploit here?
Saintz
SaintzOP10mo ago
usually you should not be able to do that in this game but since u can use alot of threads and proxys you can do it but i want the code to run smoother
Jimmacle
Jimmacle10mo ago
why do kids come in here thinking we'll help them cheat
Saintz
SaintzOP10mo ago
its not a cheat its an exploit and its related to a kids game so
Jimmacle
Jimmacle10mo ago
same difference and that doesn't change the fact it breaks the rules
Saintz
SaintzOP10mo ago
i mean its just something you could do normally aswell but it would take more time as you would have to farm normally so its just more likely it does the task automatic.
Jimmacle
Jimmacle10mo ago
which is another way to say cheating
Saintz
SaintzOP10mo ago
nope cheating is a difference
leowest
leowest10mo ago
:kekw:
Saintz
SaintzOP10mo ago
big big difference
Jimmacle
Jimmacle10mo ago
botting, exploiting, cheating it's all against the rules
Saintz
SaintzOP10mo ago
its an old kids game which barely have players so does it matter if i do it automated
leowest
leowest10mo ago
Automating things in a way humans cannot is taking advantage of the system aka cheating u said your self its something u can do but takes more time
Saintz
SaintzOP10mo ago
yes
Nox
Nox10mo ago
!ban 558887340555108375 Defending council claims he's not cheating, Mr. Spectre how are we proceeding? Well your honor, it's all the same. Exploits, hacks, all for shame. He knows he's guilty, see him stutter? Let's do the right thing, kick his ass to the gutter.
Want results from more Discord servers?
Add your server