使用apc_store vs apc_add的任何性能优势(反之亦然)?

While I understand the differences between apc_store and apc_add, I was wondering if using one or the other has any performance benefits?

One would think apc_store COULD be a bit quicker since it does not need to do a check-if-exists before doing the insert.

Am I correct in my thinking?

Or would using apc_add in situations where we know FOR SURE that the entry does not exist prove to be a bit faster?

Short: apc_store() should be slightly slower than apc_add().

Longer: the only difference between the two is the exclusive flag passed to apc_store_helper() that in turns leads to the behavior difference in apc_cache_insert().

Here is what happens there:

if (((*slot)->key.h == key.h) && (!memcmp((*slot)->key.str, key.str, key.len))) {
    if(exclusive) {
        if (!(*slot)->value->ttl || (time_t) ((*slot)->ctime + (*slot)->value->ttl) >= t) {
            goto nothing;
        }
    }
    // THIS IS THE MAIN DIFFERENCE
    apc_cache_remove_slot(cache, slot TSRMLS_CC);**
    break;
} else 
    if((cache->ttl && (time_t)(*slot)->atime < (t - (time_t)cache->ttl)) || 
        ((*slot)->value->ttl && (time_t) ((*slot)->ctime + (*slot)->value->ttl) < t)) {
        apc_cache_remove_slot(cache, slot TSRMLS_CC);
        continue;
    }

    slot = &(*slot)->next;      
}

if ((*slot = make_slot(cache, &key, value, *slot, t TSRMLS_CC)) != NULL) {
    value->mem_size = ctxt->pool->size;

    cache->header->mem_size += ctxt->pool->size;
    cache->header->nentries++;
    cache->header->ninserts++;
} else {
    goto nothing;
}

The main difference is that apc_add() saves one slot removal if the value is already present. Real world benchmarks would obviously make a lot of sense to confirm that analysis.