Reputation: 41
Here is a leaderboard prototype for ranking on the left column and could be user indices on the right. The matrix stays sorted. It might get a lot of traffic. Typical size 100,000 and up. (4 2 $0 342 0 54 1 3 1 542) leaderboard1 1 1324
leaderboard1=:{{ (z{.x),y,(z}.x) [ z=. (0{"1 x) i. 0}y }}
I noticed this special combination - x i.!.1 y - is very fast to find/i. - using a sorted array. Is there a way to open a slot (in place) at that row position to insert (0 54768) or similar? The array would have plenty of zero room at the top. I might use a try. catch. to then fill more zeros. The left column ranking might be 0-10 or 0-100. Or is there a way to insert in place using leaderboard1?
My guess is it would be much faster compared to leaderboard1.
Good reference for - "A Method for Fast Leaderboard Calculations in Massive Online Game-Based Environments"
https://onlinelibrary.wiley.com/doi/10.1155/2018/3234873
Upvotes: 1
Views: 60