Closed thesecretmaster closed 5 years ago
This should add key based storing to the command line as well (as suggested in #3).
I think that because I'm lazy I'm just going to use the code from here. However, For benchmarking purposes, it may be nice to add a field to the thread_info_list
struct which will keep timing data on various parts of each function. It should be in the thread_info_list
struct becuase then the code doesn't need to be thread safe and it can just be aggregated at the end. Actually, now, as I type this, I think it may also be good to have a thread_info_list_header struct that holds a pointer to the root node of the thread_info_list and also aggregates perf data when threads are killed. That last bit might actually be overkill.
Completed in https://github.com/thesecretmaster/predis/commit/95d27878f2d9ce962bae420dc81a0382ad4eff7f (also see follow up in #14)
Currently, the commands work so that a
set
command returns you a 'magic number' which you can then use to retrieve the data with aget
command or delete it with adel
command. Instead of doing this, I think it'd be best to have the commands take string keys, then use a hashmap to map those keys to the 'magic number'. This is in part because upon deletion, the old index will still be valid and if accessed could cause data corruption.