Fast Lookups for Mobile Number Prefixes.

Reply

Join Date: Nov 2008
Posts: 823
Reputation: verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough 
Solved Threads: 73
verruckt24's Avatar
verruckt24 verruckt24 is offline Offline
Practically a Posting Shark

Fast Lookups for Mobile Number Prefixes.

 
0
  #1
Jun 23rd, 2009
The environment of my application is as mentioned below :

The application is a Router/Accounter library used to identify an appropriate Route (and also the price for that) when a destination for a Mobile number is queried through the API. The Route to be used for sending an SMS message depends on two things the, one the destination prefix and the two the user/client sending the SMS message.

To explain the environment in more detail, lets say an External application queries my library with details of a mobile number say 919833XXXXXX, and user say smssender. Now the route to be used for sending this message will be identified by checking if the user is have a mapping for any of the prefixes in the destination say 91 or 919833. This is where my problem lies. Given a destination I want to find out all the prefixes for the destination and then check if the user has a mapping for any of these. I am currently using a HashMap to store the Prefixes (from the Prefix master) as Keys and their details as the Values. So to find a prefix I simply run a
  1. containsKey()
method with a substring of the destination which gives me the prefix.

I want to know whether is there any faster more optimized way to do this search, maybe some data structure which is more suitable to such lookups than the HashMap or anything else that would possibly optimize my looking up further.

Currently the typical times for the lookups are ~30msecs for 10K lookups.

This application is written in Core Java and mostly called by a plugin Servlet.

Note : I have already considered the possibility of using a Constant Database such as the CDB with the SG-CDB interface for Java, but since this uses hash tables internally, which I am already using through the use of a HashMap, I guess it won't be much of performance booster, if it would be pls note so how.

Thanks for your help already.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 31
Reputation: xyzt is an unknown quantity at this point 
Solved Threads: 0
xyzt xyzt is offline Offline
Light Poster

Re: Fast Lookups for Mobile Number Prefixes.

 
0
  #2
Jun 23rd, 2009
i'm not sure but maybe it will be faster if you write a C function that does this job and use it via JINI..
just a suggestion.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC