Right now len() API does a full table walk to count the number of items indexed. Since we cannot guarantee point-in-time-snapshot, why don't we maintain n_count that gets atomically incremented or decremented for insert/delete operations. This can make len() call very cheap.
Right now len() API does a full table walk to count the number of items indexed. Since we cannot guarantee point-in-time-snapshot, why don't we maintain n_count that gets atomically incremented or decremented for insert/delete operations. This can make len() call very cheap.