Change to overlap_size():
Change to overlap_size():

  The ranges in the registry are sorted by start position.  When
  calculating the overlap with a query range, a loop goes through the
  registered ranges and checks for overlaps between each range and the
  query.  This change will terminate this loop when all the remaining
  start positions are larger than the end position of the query range.

  This cuts the running time for this routine by 90% in some
  applications that registers a large number of ranges.

Tested.

Ensembl/ensembl,danstaines/ensembl,at7/ensembl,at7/ensembl,james-monkeyshines/ensembl,muffato/ensembl,mjg17/ensembl,james-monkeyshines/ensembl,james-monkeyshines/ensembl,muffato/ensembl,willmclaren/ensembl,Ensembl/ensembl,mjg17/ensembl,mjg17/ensembl,danstaines/ensembl,willmclaren/ensembl,muffato/ensembl,james-monkeyshines/ensembl,mjg17/ensembl,at7/ensembl,danstaines/ensembl,Ensembl/ensembl,muffato/ensembl,at7/ensembl,Ensembl/ensembl