Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. # 100mil 'entities'
  2. # need to be able to check from a random subset if 'something' is TRUE or FALSE
  3.  
  4. # set booleans in a redis bitmap where the ID for the entities are the offset
  5.  
  6. $ redis-cli
  7.  
  8. > SETBIT mybitmap 100000000 1 # 8ms
  9. > SETBIT mybitmap 99999999 1 # 2ms
  10. > SETBIT mybitmap 10000000 1 # 2ms, etc
  11. > SETBIT mybitmap 1000000 1
  12. > SETBIT mybitmap 100000 1
  13. > SETBIT mybitmap 10000 1
  14. > SETBIT mybitmap 1000 1
  15. > SETBIT mybitmap 100 1
  16. > SETBIT mybitmap 10 1
  17. > SETBIT mybitmap 1 1
  18.  
  19. # memory used for this bitmap 16MB
  20.  
  21. > GETBIT mybitmap 99999999 # 2ms
  22. > GETBIT mybitmap 99988889 # 2ms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement