0

In Myrrix, what are the differences (mainly in terms of performance - time taken, memory) between doing a recommend query for a particular user, and doing a recommendToAnonymous query by treating that user as anonymous and feeding that user's items (suppose we have a huge optimized MySQL database with caches and bells to retrieve those) into recommendToAnonymous.

Are there any significant performance penalties with the latter, neglecting the extra DB call?

Nilesh
  • 1,222
  • 1
  • 11
  • 23

1 Answers1

2

They are nearly identical in speed. The 'anonymous' method has to form a temporary user vector, which takes time proportional to the # of items passed, but this is quite fast. Neither uses any significant memory.

The problem with always using the anonymous method is that you would have no data actually in your model then!

Sean Owen
  • 66,182
  • 23
  • 141
  • 173
  • "you would have no data actually in your model then!" - I didn't get what you mean. Suppose my model already contains the user-item pairs, but instead of direct recommend, I use the anonymous method always. What problem would it cause? – Nilesh Jul 26 '13 at 14:21
  • If you already went to the trouble of adding your data, then just use the normal recommend method. I thought the premise was to not have to copy that data into the system from your database? – Sean Owen Jul 26 '13 at 14:51
  • I understand. No, actually the data will be copied into the system too. It's just that the items for a particular user will be added/removed multiple times in a minute and real-time recommendations will be fetched. Instead of doing multiple set/put of preferences, I'm thinking about simply treating it as anonymous and sending the current lot of items/preferences to fetch the recommendation to reduce the number of HTTP requests. The model is finally updated through a cron job once a day. – Nilesh Jul 26 '13 at 15:07
  • OK. I would probably still advise you to do the simple thing and use the normal recommend method, and send in your data normally in real-time, and see if there's any problem first. It shouldn't be, really. – Sean Owen Jul 26 '13 at 15:51
  • I see...okay, I'll try doing that. Thanks! :) – Nilesh Jul 27 '13 at 16:21