Skip to content

Conversation

nfm
Copy link

@nfm nfm commented Sep 1, 2015

It looks like when this feature was added the calculation of winning alternatives was meant to take place only once per day.

The #calc_winning_alternatives method was never called, which was meant to be saving the experiment's last calc_time.

Update the experiment view to call this method instead of the #estimate_winning_alternative method directly. Fix caching so that the #calc_time= metreturn value of hod is called, rather than assigning to a local variable. Update calc_time so that number of days since epoch is stored, rather than the day of month (1-31). Ensure we're comparing integer values, rather than the string value Redis returns from #hget.

It's worth noting that this pull request changes the value that #calc_winning_alternatives returns - it will now return nil if there was a cache was hit. Given nothing was previously calling this method I think that's probably ok. If not, we can refactor things a little to make it easier to return the cached value.

On a side note, I ran into this because our Split dashboard was too slow to load and was timing out on Heroku (30+ second request time with around 40 experiments). I'm not very across the statistical method for calculating the winning alternative - is it possible to speed this up at all, or reduce the number of iterations without compromising the result? It's a relatively expensive operation, and it would be nice to not have to cache the result.

/cc @caser

… the dashboard is loaded

It looks like when this feature was added, the calculation of winning
alternatives was meant to take place only once per day.

The #calc_winning_alternatives method was never called, which was meant
to be saving the experiment's last calc_time. Update the experiment view
to call this method instead of the #estimate_winning_alternative method
directly. Fix caching so that the #calc_time= method is called, rather
than assigning to a local variable. Update calc_time so that number of
days since epoch is stored, rather than the day of month (1-31). Ensure
we're comparing integer values, rather than the string value Redis
returns from #hget.
@andrew
Copy link
Member

andrew commented Oct 5, 2015

This looks like good catch @nfm, I don't have much free time to investigate the performance issue on the dashboard but maybe you can open a separate issue about it to see if anyone else is available for helping out?

andrew added a commit that referenced this pull request Oct 5, 2015
@andrew andrew merged commit de03148 into splitrb:master Oct 5, 2015
@nfm
Copy link
Author

nfm commented Oct 6, 2015

Thanks Andrew. I've opened another request and asked Casey to chime in (he wrote the implementation of that feature).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants