Oran Agra
11fe272c1a
Optimize HRANDFIELD and ZRANDMEMBER case 4 when ziplist encoded ( #8444 )
...
It is inefficient to repeatedly pick a single random element from a
ziplist.
For CASE4, which is when the user requested a low number of unique
random picks from the collectoin, we used thta pattern.
Now we use a different algorithm that picks unique elements from a
ziplist, and guarentee no duplicate but doesn't provide random order
(which is only needed in the non-unique random picks case)
Unrelated changes:
* change ziplist count and indexes variables to unsigned
* solve compilation warnings about uninitialized vars in gcc 10.2
Co-authored-by: xinluton <xinluton@qq.com>
2021-02-07 16:55:11 +02:00
..
2021-01-20 11:47:06 +02:00
2021-01-21 11:56:08 +02:00
2020-11-09 21:48:56 -08:00
2020-04-08 12:55:57 +02:00
2021-01-19 22:57:30 +02:00
2021-01-19 22:57:30 +02:00
2021-01-19 22:57:30 +02:00
2021-01-19 22:57:30 +02:00
2020-08-28 11:54:10 +03:00
2021-01-28 12:09:11 +02:00
2021-01-28 12:09:11 +02:00
2021-01-29 14:35:10 +08:00
2020-03-07 19:38:27 +08:00
2020-12-13 17:09:54 +02:00
2020-12-23 19:13:12 -08:00
2020-12-23 19:13:12 -08:00
2020-12-23 19:06:25 -08:00
2021-01-29 15:38:30 +02:00
2021-01-08 23:35:30 +02:00
2021-02-07 12:36:56 +02:00
2021-02-07 12:36:56 +02:00
2021-01-20 22:08:05 -08:00
2021-01-13 12:36:03 -08:00
2021-01-28 18:17:39 +02:00
2020-12-06 15:30:29 +02:00
2020-11-25 13:37:54 -08:00
2020-10-28 21:13:44 +02:00
2020-03-22 14:42:03 +02:00
2019-03-01 17:53:14 +01:00
2021-01-09 19:52:42 +02:00
2020-04-24 17:00:03 -07:00
2021-01-05 09:15:10 +02:00
2020-04-24 17:11:21 -07:00
2021-01-22 09:37:25 +02:00
2021-01-04 17:02:57 +02:00
2020-12-21 22:57:45 -08:00
2021-01-27 18:56:43 +02:00
2020-12-23 15:52:07 +02:00
2020-12-23 15:52:07 +02:00
2020-09-10 13:43:38 +03:00
2018-07-03 18:19:46 +02:00
2021-01-07 23:36:54 -08:00
2021-01-26 09:45:53 +08:00
2020-08-28 11:54:10 +03:00
2021-02-04 18:08:35 +02:00
2021-02-04 18:08:35 +02:00
2021-02-04 18:08:35 +02:00
2020-04-09 17:48:29 +08:00
2020-12-12 02:21:05 +02:00
2019-02-24 21:38:15 +01:00
2021-01-31 12:16:58 +02:00
2020-12-23 19:06:25 -08:00
2021-01-09 19:52:42 +02:00
2020-12-06 14:54:34 +02:00
2021-01-04 17:02:57 +02:00
2020-10-27 15:04:18 +02:00
2021-01-15 15:32:58 +02:00
2020-12-06 14:54:34 +02:00
2020-12-06 14:54:34 +02:00
2018-09-18 17:04:00 +08:00
2020-09-10 13:43:38 +03:00
2019-10-28 11:10:58 +01:00
2020-09-10 13:43:38 +03:00
2020-05-05 23:35:08 -04:00
2020-12-06 14:54:34 +02:00
2020-09-10 13:43:38 +03:00
2020-12-23 15:52:07 +02:00
2020-09-29 15:52:13 +03:00
2019-11-19 17:23:47 +08:00
2021-02-05 19:54:01 +02:00
2020-08-28 11:54:10 +03:00
2020-08-28 11:54:10 +03:00
2020-12-23 15:52:07 +02:00
2020-12-23 15:52:07 +02:00
2021-01-04 14:48:28 +02:00
2021-02-02 10:54:19 +02:00
2020-09-10 13:43:38 +03:00
2021-01-04 17:02:57 +02:00
2021-01-04 17:02:57 +02:00
2021-01-09 19:52:42 +02:00
2020-09-10 13:43:38 +03:00
2021-01-09 19:52:42 +02:00
2020-09-10 13:43:38 +03:00
2021-01-12 08:22:53 +02:00
2020-09-22 10:18:07 +03:00
2021-02-07 12:36:56 +02:00
2019-05-08 12:13:45 +01:00
2020-12-23 15:52:07 +02:00
2021-02-07 12:36:56 +02:00
2018-07-13 10:51:58 +02:00
2020-12-06 14:54:34 +02:00
2021-01-29 15:38:30 +02:00
2019-10-02 11:30:20 +02:00
2021-01-28 13:18:05 -08:00
2020-07-24 14:40:19 +08:00
2019-10-07 21:06:30 +03:00
2021-01-15 15:32:58 +02:00
2021-01-28 18:17:39 +02:00
2021-01-28 18:17:39 +02:00
2020-12-06 14:54:34 +02:00
2021-01-28 12:09:11 +02:00
2021-01-29 15:38:30 +02:00
2021-01-29 15:38:30 +02:00
2020-10-25 14:14:05 +02:00
2020-12-08 11:27:30 +02:00
2019-09-12 12:21:37 +02:00
2019-09-12 12:21:37 +02:00
2020-09-10 13:43:38 +03:00
2021-01-04 17:02:57 +02:00
2019-12-02 00:28:41 -05:00
2021-01-04 10:28:47 +02:00
2020-09-10 13:43:38 +03:00
2021-01-28 16:19:43 +02:00
2021-02-07 16:55:11 +02:00
2020-12-29 22:37:37 -08:00
2021-01-29 10:47:28 +02:00
2021-02-02 10:51:19 +02:00
2021-01-27 19:47:26 +02:00
2021-02-07 16:55:11 +02:00
2020-12-21 22:57:45 -08:00
2020-07-21 08:13:05 +03:00
2020-12-13 11:11:29 +02:00
2021-01-08 00:00:35 -08:00
2021-01-18 11:37:05 +02:00
2021-01-18 11:37:05 +02:00
2020-12-06 14:54:34 +02:00
2020-10-11 17:21:58 +03:00
2021-02-07 16:55:11 +02:00
2021-02-07 16:55:11 +02:00
2020-12-06 14:54:34 +02:00
2020-12-06 14:54:34 +02:00
2021-01-08 23:35:30 +02:00
2020-12-06 14:54:34 +02:00