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