How much effort would be required to get memc to equal or surpass memcached's performance? Would it require rewriting the datastructures from scratch? Fine-tuning or rewriting the tokio?
Would be surprised if it didn't, and most of the time it should probably be even.
It's the edge cases that separates naive implementation from industrial usage. And off the shelf concurrent hashmaps are already pretty advanced.
Both of these are things a high quality allocator (jemalloc in this case) has to to optimize for as well (in this context "allocation calls" corresponds to syscalls). For example they also allocate different sizes from different buckets.
Applications do have some abilities an allocator does not have, for example:
* It can move allocations, since it can invalidate pointers. This allows defragmentation/compaction to happen
* It can try to predict how long lived an allocation will be
But it's not clear to me if any of these are important for performance.
No it doesn't. A cursory scan through the code will tell you as much.
[1]: https://docs.rs/dashmap/latest/dashmap/