Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account
This post has been closed. You can still view previous posts, but you can't post any new replies.

Performance problems with large numbers of nested attribute substitutions...

I don't know if this is really a bug, the roll still works, but it takes 20-25 seconds to show up in chat. During that time I cannot do anything else. I can work around it with the info I have on the newer version of the character sheet I'm making, but its a really ugly and long process. I was going to give way more info than you want about the system but suffice to say that this... [[@{years-remaining0}]] [[@{days-remaining0}]] [[@{hours-remaining0}]] [[@{minutes-remaining0}]] [[@{seconds-remaining0}]] by the time all the attributes that call other attributes are expanded and substituted into the formulas with the numbers turns into something closer to this... /r [[((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))]]-([[floor(((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))/31536000)]]*31536000+ [[floor((((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))-(floor(((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))/31536000)*31536000))/86400)]]*86400+ [[floor((((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))-(floor(((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))/31536000)*31536000+floor((((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))-(floor(((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))/31536000)*31536000))/86400)*86400))/3600)]]*3600+ [[floor((((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))-(floor(((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))/31536000)*31536000+floor((((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))-(floor(((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))/31536000)*31536000))/86400)*86400+floor((((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))-(floor(((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))/31536000)*31536000+floor((((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))-(floor(((@{span}*31536000)-([[(((@{0-year}*31536000)+((@{0-month}+@{0-day})*86400)+(@{0-hour}*3600)+(@{0-minute}*60)+@{0-second})-((@{1-year}*31536000)+((@{1-month}+@{1-day})*86400)+(@{1-hour}*3600)+(@{1-minute}*60)+@{1-second})+(@{prev-years-spent}*31536000+@{prev-days-spent}*86400+@{prev-hours-spent}*3600+@{prev-minutes-spent}*60+@{prev-seconds-spent}))]]))/31536000)*31536000))/86400)*86400))/3600)*3600))/60)]]*60) See the bold part up top? All this is in that. Each part before that uses a smaller and smaller part of this as the time it describes gets longer. Sending this to chat provides a result in about a second and a half. Sending it as [[@{seconds-remaining0}]] takes 10 seconds. Sending the others with it bring you up to 20-25.
1435730741
Gen Kitty
Forum Champion
Holy nested attributes, Batman! :) To see if it helps at all , would you mind running through our standard troubleshooting guide ? (Temporarily disable all browser add-ons and extensions, temporarily pause your anti-virus, and try switching browsers). If the issue persists, move on to Step 4 and we'll see what can be done.
1435731935

Edited 1435732044
Roger A.
Sheet Author
here is the log for the way that takes forever... reflow: 0.78ms reflow: 0.65ms "Finished after going 11 levels deep." app.js:40:25608 "Begin processing op!" app.js:40:27475 "Levels deep: 0" app.js:40:28379 "CLICKED" app.js:35:32020 reflow: 0.71ms function p.expr.filters.hidden, jquery.min.js line 2 "Finished 0" app.js:40:28209 "Levels deep: 0" app.js:40:28236 "Inline rolls complete!" app.js:40:27034 reflow: 0.16ms function p.cssHooks[b].get, jquery.min.js line 2 reflow: 0.98ms function p.cssHooks[b].get, jquery.min.js line 2 reflow: 0.35ms reflow: 0.77ms reflow: 0.79ms and here is for the quick way.... reflow: 0.69ms "Finished after going 2 levels deep." app.js:40:25608 "Begin processing op!" app.js:40:27475 "Levels deep: 1" app.js:40:28379 "CLICKED" app.js:35:32020 reflow: 0.67ms function p.expr.filters.hidden, jquery.min.js line 2 "Finished 0" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 0" app.js:40:28273 "Levels deep: 0" app.js:40:28379 "Levels deep: 1" app.js:40:28379 "Finished 1" app.js:40:28209 "Levels deep: 0" app.js:40:28236 "There's a nested inline roll in here. Ignore for now" app.js:40:28011 "Levels deep: 1" app.js:40:28379 "Finished 2" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 2" app.js:40:28273 "Levels deep: 0" app.js:40:28379 "Levels deep: 1" app.js:40:28379 "Finished 3" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 3" app.js:40:28273 "There's a nested inline roll in here. Ignore for now" app.js:40:28011 "Levels deep: 1" app.js:40:28379 "Finished 4" app.js:40:28209 "Levels deep: 0" app.js:40:28236 "There's a nested inline roll in here. Ignore for now" app.js:40:28011 "Levels deep: 1" app.js:40:28379 "Finished 5" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 5" app.js:40:28273 "Levels deep: 0" app.js:40:28379 "Levels deep: 1" app.js:40:28379 "Finished 6" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 6" app.js:40:28273 "Levels deep: 1" app.js:40:28379 "Finished 7" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 7" app.js:40:28273 "There's a nested inline roll in here. Ignore for now" app.js:40:28011 "Levels deep: 1" app.js:40:28379 "Finished 8" app.js:40:28209 "Levels deep: 0" app.js:40:28236 "There's a nested inline roll in here. Ignore for now" app.js:40:28011 "Levels deep: 1" app.js:40:28379 "Finished 9" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 9" app.js:40:28273 "There's a nested inline roll in here. Ignore for now" app.js:40:28011 "Levels deep: 1" app.js:40:28379 "Finished 10" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 10" app.js:40:28273 "Levels deep: 0" app.js:40:28379 "Levels deep: 1" app.js:40:28379 "Finished 11" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 11" app.js:40:28273 "Levels deep: 1" app.js:40:28379 "Finished 12" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 12" app.js:40:28273 "Levels deep: 1" app.js:40:28379 "Finished 13" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 13" app.js:40:28273 "Levels deep: 1" app.js:40:28379 "Finished 14" app.js:40:28209 "Levels deep: 0" app.js:40:28236 "Levels deep: 1" app.js:40:28379 "Finished 15" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 15" app.js:40:28273 "There's a nested inline roll in here. Ignore for now" app.js:40:28011 "Finished 16" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 16" app.js:40:28273 "There's a nested inline roll in here. Ignore for now" app.js:40:28011 "Finished 17" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 17" app.js:40:28273 "There's a nested inline roll in here. Ignore for now" app.js:40:28011 "Finished 18" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 18" app.js:40:28273 "There's a nested inline roll in here. Ignore for now" app.js:40:28011 "Finished 19" app.js:40:28209 "Levels deep: 1" app.js:40:28236 "Substituting for 19" app.js:40:28273 "Levels deep: 0" app.js:40:28379 "Finished 20" app.js:40:28209 "Levels deep: 0" app.js:40:28236 "Inline rolls complete!" app.js:40:27034 reflow: 0.5ms reflow: 0.29ms reflow: 0.22ms function p.cssHooks[b].get, jquery.min.js line 2 reflow: 0.49ms function p.cssHooks[b].get, jquery.min.js line 2 reflow: 0.38ms reflow: 0.84ms link to the campaign I am testing this all in: [[Link Snipped]]
1435732017
Gen Kitty
Forum Champion
Roger, I'm editing out the link to the campaign. You don't need the whole world crashing your game :>
Hi Roger, What are you trying to accomplish with your nested equation? Depending on what it is, I might be able to suggest an API script that could accomplish the same thing in a much simpler fashion.
I'm sure the api could be used to do it easier, but the sheet was something i made as a trade for art assets. It is possible you can come up with a simpler way to do the math though. What I have it set up to is take a starting date and time in the format Y,M,D,h,m,s(each part stored as a separate atribute) convert it to a number of seconds since 0, convert the ending date and time the same way, figure out the difference between the times(all the stuff up to here works pretty quick even with the atrribute substitutions) subtract that from the amount of time you can travel between resting(again converted to seconds, and depending on your level this can be 10000 years or more) then take the amount of time you can still travel (which is in seconds) and convert that to years, days, hours, minutes, seconds again to display it. All of the info is displayed at the same time on the character sheet, you can check out the span log on the continuum sheet to see how it all displays currently. When you have more than a few spans(a jump through time) on the sheet it gets really slow, so I was rewritting it to only have only 1 span, and i was planning to make a sheet button to send all the info to the chat so it could be copied and pasted into a repeating section of text areas for record keeping. On the sheet 1 span displays pretty quick and changing a number updates everything else almost instantly, but when it gets sent to chat it doesnt seem to like it.
I am currently planning to do the manual substitution of everything but the lowest level attributes and store that in the button on the sheet, since that will give me the result i want in a reasonable time, but it would be nice to have something less unwieldy to work with.
did you guys push out an update to fix this? or does it maybe have something to do with the number of people playing at a time? the same rolls that were taking 10 seconds or more just the other day are going through in 1-2 now......
1435852959

Edited 1435853010
I don't believe we pushed anything out yesterday but the speed could vary day to day based on traffic to our dice server. I'll see if we can do anything script wise but it sounds good that it is updating faster! What character sheet is this for? A custom one?
Right now I am using a custom sheet that is intended to replace the current version of the continuum sheet I made when it is finished.
Are you still having an issue with performance? I didn't get a chance to do any script work this past weekend due to the holiday.
I haven't had any problems during my recent testing, but that has all been during off peak hours. If I see the problems again I will let you know.
Apparently I excel at breaking things. I don't know what is happening, but it isn't the large number of attribute substitutions causing the problem. It doesnt seem to have anything to do with peak vs non peak times either. The parts that were causing the problem the first time are working fine now, but I added more things to the sheet and now they are giving me problems like what the other sections were.this time I went through tha attribute substitutions manually and checked at the level of any attributes that were left being a number input, but that didn't give me the performance improvement it did last time. So, I took it all the way to actual numbers. Still takes forever. Here is the fully substituted version. [[((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)-((floor((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)/31536000))*31536000+(floor(((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)-((floor((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)/31536000))*31536000))/86400))*86400+(floor(((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)-((floor((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)/31536000))*31536000+(floor(((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)-((floor((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)/31536000))*31536000))/86400))*86400))/3600))*3600+(floor(((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)-((floor((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)/31536000))*31536000+(floor(((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)-((floor((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)/31536000))*31536000))/86400))*86400+(floor(((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)-((floor((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)/31536000))*31536000+(floor(((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)-((floor((((8*31536000)+((31+4)*86400)+(3*3600)+(15*60)+12)+9*31536000+11*86400+7*3600+5*60+2)/31536000))*31536000))/86400))*86400))/3600))*3600))/60))*60))]] You can copy and paste into any campaign and it will work. on my desktop it takes about 30 seconds in firefox. My laptop takes about 55 seconds. I gave chrome a couple minutes before I gave up. no errors in the console, but here is a screenshot of the performance profiler in firefox in case that helps.
Alright, I was just talking with the other devs. Short term, I would look into using an API script to accomplish what you are trying to do. Some guidance for this can be found at <a href="https://wiki.roll20.net/API:Introduction" rel="nofollow">https://wiki.roll20.net/API:Introduction</a> and <a href="https://wiki.roll20.net/API:Script_Index" rel="nofollow">https://wiki.roll20.net/API:Script_Index</a> . You might also post in the API forums and see if anyone can help you accomplish this. Long term, we will try to look into what is causing the dice parser to get stuck as it is in your macro.
Understood. Thanks for the help.