C
C#3mo ago
Saintz

How to make this Faster?

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