It would be much more efficient to have a “component container” behaviour in your material rack and have some other logic place and remove the material components there when the components are physically moved in and out. For example the robot grasp and release actions can do that.
With the component container you can then have a Python script in your material rack subscribe to the vcContainer OnTransition event and in that event handler use the component position to calculate which slot the component was added to or removed from. Once you know the slot you can e.g. trigger a corresponding signal behaviour.
If you really need to have this be “passive”, then having separate volume sensors for each slot should still work with decent performance if you set them up correctly. I suspect that generally the performance issue you are facing is coming from repeated world updates or component rebuilds.
- Assign same SampleTime to all of them and “UpdateScene” Enabled only on the first one to avoid unnecessary world updates
- Set TestMethod to any other than “Precise Test”
- Disable TestParent, TestSiblings and ShowVolume