You would need sorted inputs (sorted per
sort-bed, not sure what
sortBed does), but for faster options,
bedops --intersect and
bedops --element-of do different kinds of intersections.
If you're counting overlaps of elements by class:
bedmap --count and
bedmap --faster --count can be useful.
You can also use the
--chrom operator with BEDOPS tools to trivially parallelize work by chromosome via GNU Parallel or HPC job schedulers.