SkriptLang / skript-reflect

Powerful reflection utilities for Skript.
MIT License
56 stars 19 forks source link

Custom events is extremely slow #89

Closed Lotzyprod closed 3 months ago

Lotzyprod commented 3 months ago

Describe the bug With new skript-reflect using custom events is extremely slow. I'll tested same script for listening packets on Skript 2.6.4 + Skript-reflect 2.3 and Skript 2.8 + Skript-reflect 2.4 Event calling on 2.6.4: average 0.5356ms Event calling on 2.8: average 26.2471ms (range from 5ms to 100ms)

To reproduce Script here. You can run this on any of specified by me versions of skript and reflect. I think its something related to sections api update. Something broken as broken parse section.

Additional info lines 609 - 613 is custom event line 615 - handling event lines 549,590, 599 event calling

Server information

Lotzyprod commented 3 months ago

After many tests, it turned out that in general, event processing in Skript has slowed down. I recreated similar code in Java and implemented a Bukkit event related to this. Then I registered the event in Skript. Calling an event via import in Skript-reflect does not cause any problems. While using a registered event produces a similar problem as described above.

Can someone move this issue to Skript repo

sovdeeth commented 3 months ago

After many tests, it turned out that in general, event processing in Skript has slowed down. I recreated similar code in Java and implemented a Bukkit event related to this. Then I registered the event in Skript. Calling an event via import in Skript-reflect does not cause any problems. While using a registered event produces a similar problem as described above.

Can someone move this issue to Skript repo

You should open a new issue there with the relevant information, like a way to reproduce. Moving this issue wouldn't be very useful since all the information is for skript-reflect.

sovdeeth commented 3 months ago

This appears to just be a misunderstanding of how Skript handles async events.