Filter irrelevant OSM data before import for faster processing

I was wondering if we could filter out osm data which are irrelevant for the graph generation, any one tried this before and what would be the elements which I can safely drop?

This is already done in OSMReader