ssb: I tried smarter data structures in my own code, but a better database index shows better performance for determining follows.
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled
This commit is contained in:
@ -1618,10 +1618,15 @@ void tf_ssb_test_following_perf(const tf_test_options_t* options)
|
||||
tf_ssb_t* ssb = tf_ssb_create(&loop, NULL, options->db_path, NULL);
|
||||
|
||||
uint64_t start = uv_hrtime();
|
||||
const char** ids = tf_ssb_db_get_all_visible_identities(ssb, 2);
|
||||
tf_free(ids);
|
||||
int count = 0;
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
const char** ids = tf_ssb_db_get_all_visible_identities(ssb, 2);
|
||||
while (ids[count]) { count++; }
|
||||
tf_free(ids);
|
||||
}
|
||||
uint64_t end = uv_hrtime();
|
||||
tf_printf("completed in %.3fs\n", (end - start) / 1e9);
|
||||
tf_printf("completed in %.3fs (%d ids)\n", (end - start) / 1e9, count);
|
||||
|
||||
tf_ssb_destroy(ssb);
|
||||
|
||||
|
Reference in New Issue
Block a user