Can APC recognise duplicate source files?

Solution 1:

Seems the answer's no, at least as things currently stand.

Solution 2:

apc.file_md5 does not solve the duplication problem because it doesn't identify the cached files. See question What does apc.file_md5 do (Alternative PHP Cache)?

To avoid duplication, perhaps symlinking some Drupal directories could work. So, instead of

/vhost1/drupal/includes/(a lot of files)
/vhost2/drupal/includes/(a lot of files)

you could have

/vhost1/drupal/includes => /path/to/drupal-master/includes/
/vhost2/drupal/includes => /path/to/drupal-master/includes/

Be aware that all Drupal instances running with this trick must be the same version... if not, bad things may happen ;-P