Looking at dmemcache.inc there are some goofy and ugly instanceof operators that could be glossed over with dmemcache_object() returning a proxy object to the two backends. I played with this a little this morning and came up with this quick and dirty patch. No performance numbers or even testing on Memcache but Memcached seems to work great. I can't imagine the performance would change much either way since we're adding some LOC in exchange for some encapsulation and maintainability and loosing a couple relatively cheap ifs.

I think the big wins are in maintainability and with another variable we could swap out a custom proxy object tuned with logic for specific sites in the psuedo-plugin system manner.

Its possible more of the dmemcache_* function logic could be embedded in these objects too but I think that'd be a bad idea.

Looking for review and general thoughts about this approach. Obviously the patch is rough with lots of missing docs and embedded questions but the concept and meat of the implementation is there.

Comments

neclimdul’s picture

StatusFileSize
new13.92 KB

non-broken patch. helps when you test on the right install...

japerry’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.