thesecretmaster / predis-v0

Like redis, but parallel and written from scratch for fun!
GNU General Public License v3.0
1 stars 0 forks source link

Add a hashtable wrapper around the index system #4

Closed thesecretmaster closed 5 years ago

thesecretmaster commented 5 years ago

Currently, the commands work so that a set command returns you a 'magic number' which you can then use to retrieve the data with a get command or delete it with a del 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.

thesecretmaster commented 5 years ago

This should add key based storing to the command line as well (as suggested in #3).

thesecretmaster commented 5 years ago

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.

thesecretmaster commented 5 years ago

Completed in https://github.com/thesecretmaster/predis/commit/95d27878f2d9ce962bae420dc81a0382ad4eff7f (also see follow up in #14)