Skript: Play sound effect takes ridiculously long to parse/reload

Created on 1 Feb 2018  路  14Comments  路  Source: SkriptLang/Skript

Using Skript dev31c

Reproduction:

command /test:
    trigger:

        play sound "entity.chicken.egg" with volume 1 and pitch 1 at command sender's location for command sender

Create this script and add it to your server. Then reload the script and see how long it takes to achieve that. I'm using skUtilities "system milliseconds" expression to output reloading times of scripts. Depending on what kind of expression i use in the play sound effect, reloading it takes between 0.5 and 2 seconds - whereas pretty much all other short scripts like this take < 0 milliseconds to reload.

https://snag.gy/3n0L7A.jpg

Update: i just upgraded to dev32d and the reloading now takes between 0.5-0.6 seconds, opposed to the prior up to 2 seconds.

enhancement medium

Most helpful comment

maybe it would be a good idea to change the syntax to (play|send) as a workaround for this

All 14 comments

What do you mean by "Depending on what kind of expression i use in the play sound effect"? Are you saying different syntaxes take longer to reload? If so you may not be using vanilla Skript syntaxes in those cases, as multiple addons have play sound effects that have a very similar syntax to ours.

@TheBentoBox sorry for being too vague on that. I meant depending on what kinda of player expressions i used. (command sender/{_player}/event-player/etc.). I was also making different tests with functions and other event types, not only just a /test command.

to add more info to this, any effect that starts with play takes a stupidly long amount of time to parse

@TheBentoBox why remove bug? the fact that anything with play takes so long to reload points to some funny business

Because it could just be poor parsing optimization rather than an actual bug. It also could be a bug or some sort of "funny business" as you put it but I shouldn't mark it as such until we know; for now, it's just more correct to label this as an enhancement to the parser, since improving parse speeds is an enhancement, not a bug fix.

maybe it would be a good idea to change the syntax to (play|send) as a workaround for this

I agree, it would be a much easier fix that working on the parser.

So I looked into this further and I can't reproduce on a server with just Skript. Do you have skrayfall installed by any chance?

Not "reproducing" parsing performance issues is a bit tricky. Could be that you have a better computer, so difference is not noticeable.

True, however I have definitely experienced this before on my PC, as I noted above.

@Pikachu920 in case you meant me: yes, i do have SkRayFall installed

Happens in 1.15.2, and Skript 2.5-alpha1 the long reload.

@ShaneBeee very please fix this in 2.5-alpha3. Kthxbye :3

@ShaneBeee very please fix this in 2.5-alpha3. Kthxbye :3

Please don't tag me on issues Im not involved in. Im not the only person on the team. Tagging me means I get an email, even though Im not part of this thread.

Was this page helpful?
0 / 5 - 0 ratings