C
C#9mo ago
Saintz

How to make this Faster?

Does someone know how to make this faster i would appreciate any help
30 Replies
Angius
Angius9mo 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
SaintzOP9mo ago
you have any fixes/corrections in this code? or should i use var?
Angius
Angius9mo 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
mtreit9mo 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
SaintzOP9mo 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
mtreit9mo ago
Why are you spinning up 250 tasks that all execute the exact same call?
Saintz
SaintzOP9mo 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
mtreit9mo ago
exploit?
Saintz
SaintzOP9mo ago
yes
Jimmacle
Jimmacle9mo ago
as someone who can't access the discord CDN at work i wish people would use the paste site
Saintz
SaintzOP9mo 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
Jimmacle9mo ago
i mean $paste
MODiX
MODiX9mo 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
SaintzOP9mo ago
ohh i see
mtreit
mtreit9mo ago
What do you mean by exploit here?
Saintz
SaintzOP9mo 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
Jimmacle9mo ago
why do kids come in here thinking we'll help them cheat
Saintz
SaintzOP9mo ago
its not a cheat its an exploit and its related to a kids game so
Jimmacle
Jimmacle9mo ago
same difference and that doesn't change the fact it breaks the rules
Saintz
SaintzOP9mo 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
Jimmacle9mo ago
which is another way to say cheating
Saintz
SaintzOP9mo ago
nope cheating is a difference
leowest
leowest9mo ago
:kekw:
Saintz
SaintzOP9mo ago
big big difference
Jimmacle
Jimmacle9mo ago
botting, exploiting, cheating it's all against the rules
Saintz
SaintzOP9mo ago
its an old kids game which barely have players so does it matter if i do it automated
leowest
leowest9mo 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
SaintzOP9mo ago
yes
Nox
Nox9mo 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