#How can i optimize the scripts?

100 messages · Page 1 of 1 (latest)

spring belfry
#

Ive got this problem where everytime I load into a world it dosent respond to commands and block updates for a solid 30 seconds, and I have a pretty powerful pc. Ive discovered this is because I have a lot of scripts, about 20k lines of code by now, with many more to come. Is there a way to optimize this?

cedar grottoBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

bitter onyx
#

I think this is where you drop your scripts that cause you the most performance issues

#

and that's also default behavior regardless of scripts if you have a lot of mods

spring belfry
#

well i cant really drop the scripts

#

i need them to change recipes

bitter onyx
#

🤷‍♂️ then we can't realy help

#

I meant send the scripts here

spring belfry
#

a

bitter onyx
#

only the ones you think cause the most issues

spring belfry
#

the biggest

final scrollBOT
#

Paste version of armornweapons.js from @spring belfry

spring belfry
final scrollBOT
#

Paste version of create.js from @spring belfry

spring belfry
final scrollBOT
#

Paste version of decostuff.js from @spring belfry

spring belfry
final scrollBOT
#

Paste version of presteam_si_random.js from @spring belfry

spring belfry
final scrollBOT
#

Paste version of removed_recipes.js from @spring belfry

spring belfry
#

these all have more than 100kn

#

kb

bitter onyx
#

Do you still have performance issues if you remove the recipe scripts?

spring belfry
#

no

#

well i did remove all of them i will try to remove just these ones

bitter onyx
#

yeah try that

#

try to look for which scripts specifically cause you the most performance issues

#

I believe recipes should at most cause longer load time on startup/first load

spring belfry
#

yea thats the issue

#

also without these big scripts i dont lag anymore

#

i might have to minimize them

bitter onyx
#

wait so do you have longer world load times everytime you join a world? or just during the first time

spring belfry
#

yea also that

#

but i still have that original problem with them

#

but without them i have neither problem

bitter onyx
#

which one?? not "yea that"

#

everytime or first time

spring belfry
#

ig everytime

#

it did load faster

bitter onyx
#

honestly I'm not sure if there's much you can do

#

wait try removing the removed recipes.js one

spring belfry
#

aight

bitter onyx
#

see if that improves load times AFTER the first time

spring belfry
#

ok

#

i will time it on my phone

bitter onyx
#

ok there's no need to do that

#

if there's a noticeable difference that is fine

spring belfry
#

oh yea its very noticable

#

from 35 seconds on the first time to about 23

bitter onyx
#

yeah that's what I thought since it's just spam loop through the entire list of items

#

but idk how we can optimize looping

spring belfry
#

ill try to minimize it to see if that helps

#

minimized first loading time is 25 seconds

bitter onyx
#

I mean 25-35 seconds isn't that bad if we have no real solutions🤷‍♂️

spring belfry
#

yea

bitter onyx
#

but then again you said its on your good pc

#

so it could be worse for others

spring belfry
#

i know thats why ill try to optimize it

#

my specs are a rtx 5060 intel i5 ultra 225 f and 32 gigs of ddr5 i say its pretty good

bitter onyx
#

You could just straight up remove the loops 💀

#

The one time ai is alright for tasks like this

real oracle
#

are you using jei+emi?

spring belfry
#

yea

#

i tried tmrv

#

but then half of the recipe types were missing

real oracle
#

did you report that to the dev?

#

it should show the same recipe types as jei

spring belfry
#

no

#

i will try it one more time

#

it was a long time ago

real oracle
#

remove EMI and see how much it changes things

spring belfry
#

but isnt tmrv dependant on emi

real oracle
#

but you are using jei?

spring belfry
#

rn im using tmrv and emi

#

the load times are about equal

#

also the "limbo" state of the world is too

real oracle
spring belfry
#

well atleast all recipe types laod now

real oracle
#

I would just remove a bunch of decorative mods

#

you seem to be removing a lot of items from them anyway

spring belfry
#

well the only deco mods i have are those macaws stuff

#

and chipped

real oracle
#

do you have every compat?

spring belfry
#

what

real oracle
#

i guess not then

spring belfry
#

ig i could try to remove the loops

#

can i automate this

real oracle
#

automate what?

spring belfry
#

holy

real oracle
#

if you mean replacing loops with just writing the removal one by one

spring belfry
#

wait

real oracle
#

it wouldnt be better

spring belfry
#

yea

real oracle
#

it would probably be worse

#

or exactly the same

bitter onyx
#

mb then

spring belfry
#

well i guess i will try to minimze them and get rid of some recipes that are no longer present

#

i ran the decostuff file through a beautifier and now its 100 kb smaller

#

ig i will minize the scripts when im uploading the pack and if anybody want to take a look inside they could look into the repo