perf: Add a quick test to measure ssb.following performance.
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled

This commit is contained in:
2025-05-12 12:32:41 -04:00
parent 1f2664e5a8
commit 35941a7ddc
3 changed files with 26 additions and 0 deletions

View File

@ -1607,4 +1607,23 @@ void tf_ssb_test_cli(const tf_test_options_t* options)
tf_free(blob);
tf_free(id);
}
void tf_ssb_test_following_perf(const tf_test_options_t* options)
{
uv_loop_t loop = { 0 };
uv_loop_init(&loop);
tf_ssb_t* ssb = tf_ssb_create(&loop, NULL, "db.sqlite", NULL);
uint64_t start = uv_hrtime();
const char** ids = tf_ssb_db_get_all_visible_identities(ssb, 2);
tf_free(ids);
uint64_t end = uv_hrtime();
tf_printf("completed in %.3fs\n", (end - start) / 1e9);
tf_ssb_destroy(ssb);
uv_run(&loop, UV_RUN_DEFAULT);
uv_loop_close(&loop);
}
#endif