Madelyn Olson
13f2b61fff
Optimize the per slot dictionary by checking for cluster mode earlier ( #995 )
...
While doing some profiling, I noticed that getKeySlot() was a fairly
large part (~0.7%) of samples doing perf with high pipeline during
standalone. I think this is because we do a very late check for
server.cluster_mode, we first call getKeySlot() and then call
calculateKeySlot(). (calculateKeySlot was surprisingly not automatically
inlined, we were doing a jump into it and then immediately returning
zero). We then also do useless work in the form of caching zero in
client->slot, which will further mess with cache lines.
So, this PR tries to accomplish a few things things.
1) The usage of the `slot` name made a lot more sense before the
introduction of the kvstore. Now with kvstore, we call this the database
index, so all the references to slot in standalone are no longer really
accurate.
2) Pull the cluster mode check all the way out of getKeySlot(), so
hopefully a bit more performant.
3) Remove calculateKeySlot() as independent from getKeySlot().
calculateKeySlot used to have 3 call sites outside of db.c, which
warranted it's own function. It's now only called in two places,
pubsub.c and networking.c.
I ran some profiling, and saw about ~0.3% improvement, but don't really
trust it because you'll see a much higher (~2%) variance in test runs
just by how the branch predictions will get changed with a new memory
layout. Running perf again showed no samples in getKeySlot() and a
reduction in samples in lookupKey(), so maybe this will help a little
bit.
---------
Signed-off-by: Madelyn Olson <madelyneolson@gmail.com>
Signed-off-by: Ping Xie <pingxie@google.com>
2024-09-15 11:49:49 -07:00
..
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-15 11:49:49 -07:00
2024-05-22 23:24:12 -07:00
2024-05-22 23:24:12 -07:00
2024-04-10 08:59:45 +02:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-05-22 23:24:12 -07:00
2024-06-16 21:18:20 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-15 11:49:49 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-05-22 23:24:12 -07:00
2024-05-22 23:24:12 -07:00
2024-09-03 09:00:45 -07:00
2024-05-22 23:24:12 -07:00
2024-09-15 11:49:49 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-07-29 21:50:46 -07:00
2024-09-15 11:49:49 -07:00
2024-07-22 18:03:28 -07:00
2024-05-22 23:24:12 -07:00
2024-09-03 09:00:45 -07:00
2024-05-22 23:24:12 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-05-22 23:24:12 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-04-09 10:24:03 +02:00
2024-09-03 09:00:45 -07:00
2024-05-02 20:00:04 -07:00
2024-05-02 20:00:04 -07:00
2024-05-08 12:17:32 -07:00
2024-04-30 19:32:01 -07:00
2024-04-30 19:32:01 -07:00
2024-04-30 19:32:01 -07:00
2024-09-15 11:49:49 -07:00
2024-09-15 11:49:49 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-15 11:49:49 -07:00
2024-09-15 11:49:49 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-06-07 01:40:55 +02:00
2024-09-03 09:00:45 -07:00
2024-05-22 23:24:12 -07:00
2024-09-03 09:00:45 -07:00
2015-07-26 15:17:18 +02:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-07-18 19:21:45 -07:00
2024-09-15 11:49:49 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-15 11:49:49 -07:00
2024-09-15 11:49:49 -07:00
2024-09-03 09:00:45 -07:00
2024-06-30 11:33:10 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2021-11-16 13:12:25 +02:00
2021-11-16 13:12:25 +02:00
2021-11-16 13:12:25 +02:00
2021-11-16 13:12:25 +02:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-04-05 21:15:57 -07:00
2024-09-15 11:49:49 -07:00
2024-05-22 23:24:12 -07:00
2023-05-02 17:31:32 -07:00
2020-12-23 15:52:07 +02:00
2020-12-23 15:52:07 +02:00
2024-09-03 09:00:45 -07:00
2024-09-15 11:49:49 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-15 11:49:49 -07:00
2024-06-26 09:47:59 -07:00
2024-05-22 23:24:12 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-05-22 23:24:12 -07:00
2024-09-03 09:00:45 -07:00
2024-09-15 11:49:49 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-07-14 20:04:47 -07:00
2024-06-07 01:40:55 +02:00
2024-07-22 18:03:28 -07:00
2024-05-22 23:24:12 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-15 11:49:49 -07:00
2024-09-15 11:49:49 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2020-10-25 14:14:05 +02:00
2024-09-03 09:00:45 -07:00
2024-05-09 19:44:40 -07:00
2024-05-09 19:44:40 -07:00
2021-11-11 13:51:33 +02:00
2021-07-10 10:04:54 -05:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-06-07 14:21:33 -07:00
2024-05-06 00:09:01 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2022-05-22 17:10:31 +03:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-15 11:49:49 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-05-28 09:27:51 -07:00
2024-05-22 23:24:12 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2020-12-06 14:54:34 +02:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-15 11:49:49 -07:00
2024-07-10 13:53:52 +02:00
2024-08-01 08:59:43 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00
2024-09-03 09:00:45 -07:00