sparse-counter: improved implementation with local_t