Start a Concert Eventually
Scott Hardie | September 25, 2014
The solution is in place and the form loads quickly now. I'm very glad to get the game back on track. Thanks for your patience!
Unfortunately, while this solution is a big improvement, my testing with very large number sets -- the kind that we'll probably reach next year -- indicates that it's not going to work forever. I'm considering other approaches and will do what I can with it. If all else fails, I can eliminate this particular bit of number-crunching and ask you to do some math in your head while choosing artists. We'll see what happens.
Fyi for anybody curious about the problem: In order to show and hide artist checkboxes on the form, the site needs to calculate all possible sums of five artists at a time from various sets of artists. If your collection consists of ranks {2,2,1,1,1}, then the only possible sum of the ranks is {7}. But if you gain another R1 then the possible sums are {6,7}, and if you then gain an R3 then the possible sums are {6,7,8,9}, and so on. When someone's collection grows really big, there becomes many possible combinations of five, and it takes ever longer for the site to count the number of possible combinations. I have taken some steps tonight to streamline the data and the calculations, and to cache the output so that I can pull up prior outcomes in the future without re-calculating them, but that won't last forever. I've tried approaching this differently with advice from other developers, applying mathematic algorithms instead of counting the artists, but so far, all of the math formulas that I've come up with have proven inaccurate when given really weird unlikely sets such as {10,10,10,10,10,1,1,1,1,1}. I'll keep trying.
Scott Hardie | September 27, 2014
Success! After trying a few more methods, I have devised a very different way of counting that relies on some pre-cached combinations. I threw enormous quantities of data at it and it was able to crunch them all, never taking more than 4 seconds at the slowest, and usually under 2 seconds. This solution is in place now, and will keep the "Start a Concert" form running smoothly forever.
This weekend, I plan to work on a number of other, much less important RB issues that have been hanging around. Thanks for the suggestions recently; I'm open to more, especially if it's pointing out something that doesn't seem to be working correctly.
Want to participate? Please create an account a new account or log in.
Scott Hardie | September 23, 2014
I'm aware of and sorry for an issue with the Start a Concert form loading slowly. The page may appear to be a blank white screen for 20-30 seconds until the form appears. Checking certain boxes may make the form disabled for the same timeframe until the options become clickable again. It's a pain.
The calculations for which artists are compatible with each other are very complicated, and growing exponentially as more artists are collected. I have started work on a much faster version of the calculations, with caching to prevent re-crunching the same numbers twice, but I haven't able to finish yet. I'll have it done asap, Wednesday night if possible, and definitely no later than this weekend. (I expect to work some late nights during this week, or it would be done sooner.)
In the meantime, please have patience for a few days. If you make a choice in the form, do something in another browser tab while it's working, and then come back to make another choice, it's easier to put up with. Thanks for understanding.
I'll comment here when the improvements are done.