How to append a new entry in a list of 100,000 names without iterating the list each time?

I have a list of 100,000 + names and I need to append to that list another 100,000 names. Each name must be unique. Currently I iterate through the entire list to be sure the name does not exist. As you can imagine this is very slow. I am new to Java and I am maintaining a 15+ year old product. Is there a better way to check for an existing name?

We are using a Java list because that is how the original developers coded it. I don't think they planned for that many entry's. I know I need to re factor this which is why I am asking for opinions on how to  make this more efficient. Currently we don't use a database for anything in the product so I would like to stay away from that if possible.
Ok - but it still raises the question in my mind as to how that data is being used.
I gave you a couple of options that will take care of the UNIQUE requirement (HashTable, HashMap) but the BEST solution depends on:
1. How often new entries are made
2. How often entries are deleted
3. How often entries are changed
4. How often entries are accessed
5. How the data is actually used
If you just have a one time requirement to merge the two lists then just do it and get it over with - it won't really matter how you do it.
But Hash classes will present their own performance issues if the typical access is for many, most or all of that 200k+ entries.
Without knowing the full set of requirements we can't really know just what part of the process needs to be optimized.

Similar Messages

  • How can i add new files to my ipod from a different computer  without losing the added files on my ipod?

    how can i add new files to my ipod touch from a diferent computer without losing the added files already on my ipod?

    Email them? Use DropBox?  What type of files?

  • How can I transfer new music from a different iTunes onto my iPod without erasing the music already on it?

    I have music on my iPhone and iPod nano from my old computer back home, and am now at college 2 hours away with my new laptop and a different repertoire. Just to be safe I tried syncing my old iPod nano with my new iTunes and rather than adding the music to my iPod it replaced all the music already on it. Is there some way I can stop this from happening with my iPod nano and my iPhone, or am I just going to have to copy everything onto CD's and do things the hard way? If anybody can help me they'll have my undying gratitude.
    Much appreciated,
    Demitra

     
    http://support.apple.com/kb/HT1329 How to use your iPod to move your music to a new computer
    http://support.apple.com/kb/HT4527 iTunes: How to move your music to a new computer

  • Hello. I just know the muse and I need an organization of customers in alphabetical order. The problem is that you will always get new customers. I need to know how to insert a new customer (square) and it already comes in alphabetical order on the page.

    Hello.
    I just know the muse and I need an organization of customers in alphabetical order. The problem is that you will always get new customers. I need to know how to insert a new customer (square) and it already comes in alphabetical order on the page. The site will be like in the link below, and each client will be a window of these: http://www.connary.com/. I look back.
    A hug, Murilo.

    I believe you are referring to thumbnail image rectangles as customers on page ? not exactly customer database ?
    You can add rectangle with different effects with mouse rollover state and regarding adding new ones , you would need to do that manually in design mode .
    Thanks,
    Sanjit

  • HT2513 How do I have ICal automatically remind me 1 day before event without doing it manually each time I add a new event?

    How do I have ICal automatically remind me 1 day before event without doing it manually each time I add a new event?
    I just want the new event to remind me a day before with an alarm or email or somthing to jog my mind.

    bump.

  • How to set up sms sending on yosemite if my country (Kyrgyzstan) is not in the list of supported countries? thanks

    how to set up sms sending on yosemite if my country (Kyrgyzstan) is not in the list of supported countries? thanks

    hello guys, i live in lebanon too and i was so frustrated by this. however i found the solution. when setting up icloud keychain, before creating a password for the keychain press on advanced options and choose not to create a password. you will ahve to use your account password to activate keychain on other device. this will bypass the sms confirmation

  • How can i format my external hard drive to write files from Mac without loosing the files that i alredy have on my external hard when i used it with windows?

    How can i format my external hard drive to write files from Mac without loosing the files that i alredy have on my external hard when i used it with windows?
    I have been using Windows to write files to my 1TB WD external hard drive and I do not want to format to loose the files capacity of around 500GB
    Someone, Please help

    Hi Allen,
    Is there any way to store the back up to Mac and restore after formating?

  • HT6058 How do I sync my contacts on my Macbook Pro to my iPad without using the cloud?

    How do I sync my contacts on my Macbook Pro to my iPad without using the cloud?
    I don't want my contacts on the cloud... it's a security thing.

    Fossiltx wrote:
    How do I sync my contacts on my Macbook Pro to my iPad without using the cloud?
    I don't want my contacts on the cloud... it's a security thing.
    Buy the Mavericks server for less than $20.
    https://itunes.apple.com/au/app/os-x-server/id714547929?mt=12

  • How do you convert .AVI files for using in iMovie without losing the original clip time and date

    Hi everyone! does anyone know how to convert .AVI files for using in iMovie without losing the original clip time and date? Handbrake, MPEG Streamclip and Evon all replace the original timecode with the date of modification. This is very frustrating when you are trying to keep the chronology right. I know that if you upload the files to iMovie from one device the chronology isn't a problem, but I'm adding video files from a couple of iPhones and a couple of camcorders. any help much appeciated.
    paul

    Hi everyone! does anyone know how to convert .AVI files for using in iMovie without losing the original clip time and date? Handbrake, MPEG Streamclip and Evon all replace the original timecode with the date of modification. This is very frustrating when you are trying to keep the chronology right. I know that if you upload the files to iMovie from one device the chronology isn't a problem, but I'm adding video files from a couple of iPhones and a couple of camcorders. any help much appeciated.
    paul

  • Newtab question: How do I ''input'' the nine (yes 3X3) boxes to be my specific permanent sites exactly the same each time I hit the newtab+?

    Newtab question: How do I ''input'' the nine (yes 3X3) boxes to be my specific permanent sites exactly the same each time I hit the newtab+? I know that I can hit the 'save' button but I want it to be MY selection before the save. Evert time I hit the newtab it seems to use my history to keep moving them up the line.
    I have used google.com/ig as my home for years. In November the sites that are my personal choices will be gone as Google has decided to eliminate "IG"!
    For example the NYTimes (with about 5-6 daily lead articles) appear in my upper left of the personalized home site. I would at least like to see that summary. At least with Newtab I can save it.
    Is there a program step in FF that I can achieve my results and put nine sites into it and click them to be permanent as well as being able to edit them in the future?

    You can change the order of the boxes on the about:newtab page and drag an item to a different slot to pin it to that position or you can remove a website by clicking the close X to block that URL.
    You can drag a bookmark or history item and drop them in a slot on the about:newtab page to pin them and have your own favorites sites showing.
    Changes made manually on the about:newtab page are stored in the browser.newtabpage.pinned (default = [null]) and browser.newtabpage.blocked prefs that you can check/modify on the about:config page.

  • I want to bulk purchase single tracks, how do i go about this without buying and paying each time

    I want to bulk purchase single tracks for my ipod, how do i go about this without buying and paying each time, can i not amass a number of tracks and then go to checkout. It seems to want to charge me each time. Help!

    Put them in your wishlist

  • How can I set up a preferred printer so I don't have to pick the printer each and every time I print something out?  At the moment, even immediately after printing one thing, it prompts me to pick a printer, which is very time consuming.

    How can I set up a preferred printer so I don't have to pick the printer each and every time I print something out?  At the moment, even immediately after printing one thing, it prompts me to pick a printer, which is very time consuming.

    Compass Health Systems wrote:
    How can I set up a preferred printer so I don't have to pick the printer each and every time I print something out?  At the moment, even immediately after printing one thing, it prompts me to pick a printer, which is very time consuming.
    No, there is not setting for a default printer.The system scans for available airprint printers each time you print.

  • How do I turn selected text in a Pages document into two columns without turning the whole document into two columns?

    How do I turn selected text in a Pages document into two columns without turning the whole document into two columns?

    Menu > Insert > Layout Break (before and after text) > click in text > Inspector > Layout > Layout > columns: 2
    Peter

  • How do i export my entire address book into excel.  I want to send the list to lady who writes a newsletter for me and she would like it in excel.  I know I did this last christmas, but cannot remember how i did it.  Please help.

    How do i export my entire address book into excel.  I want to send the list to lady who writes a newsletter for me and she would like it in excel.  I know I did this last christmas, but cannot remember how i did it.  Please help.

    export and import to csv
    or here are other options
    http://www.google.dk/search?source=ig&hl=da&rlz=1G1TSEH_ENDK367&q=ohm+law&oq=ohm +law&aq=0&aqi=g3&aql=&gs_sm=e&gs_upl=848060l852340l0l853488l7l7l0l1l1l0l216l774l 1.2.2l5l0#sclient=psy-ab&hl=da&rlz=1G1TSEH_ENDK367&source=hp&q=export%20contacts %20to%20excel%20outlook%202010&pbx=1&oq=export%20contacts%20to%20exc&aq=1L&aqi=g -L4&aql=&gs_sm=sc&gs_upl=1097767l1103601l0l1106743l22l11l0l10l10l0l288l2210l1.4. 6l21l0&bav=on.2,or.r_gc.r_pw.,cf.osb&fp=a68934164527e931&biw=1631&bih=731&pf=p&p dl=300

  • How to save multiple new entries in one shot?

    Hi,
    I am working on a pretty complex Create form. So apart from the standard form fields to allow user to enter the data, one of the sections in this form is a table which allows user to create multiple entries for this entity. And when hitting the "Save" button in this form, it will save all the data plus the multiple entries defined in this table.
    Is it possible to create multiple new entries in a table, and then save all of the new entries at the end? My experience so far is only create and save one new entry at a time.
    Any sample?
    Please advise.
    Thanks.
    -Mina

    Yes, I am using ADF BC.
    Let me explain more in details of the scenario:
    I have a table with "Create New" and "Save" button. The "Create New" button's ActionListener is set to "#{bindings.CreateInsert.execute}", and the "Save" button's ActionListener is set to "#{bindings.Commit.execute}".
    When the "Create New" button is hit, a new row shows up in the table to allow entering data inline. When the "Save" button is hit, it got committed. I would like to allow user to create multiple rows before committing. But currently, after I hit "Create New" button, then enter data, then hit "Create New" button again without committing, it gives error.
    Since this table is part of a form with other fields, I would like to save/commit it until everything in the form are completed, including creating multiple rows in the table.
    Any ideas how to achieve this?
    Any comments are appreciated.
    Thanks.
    -Mina

Maybe you are looking for

  • EPrint / cloud print issue.

    Hi, I have 3 HP Officejet Pro 8600 + printers running on different network setups at 3 different locations. When I try to print from remote locations using Google Cloud Print, it doesn't work. When I login to HP eprint manager (https://www.hpconnecte

  • Qosmio G40 Video input switch

    Hello, Under Vista Media center, I am able to watch TNT using integrated TNT Tuner. I am also able to watch TV with external TV box (connected to the integrated video input). But I have to reconfiguring the TV Signal under Media Center and lost my TN

  • Deleting Flickr-albums in Aperture

    Hi, When I delete a Flick-album in Aperture all photos are deleted on Flickr. I don't want this... Is there a way to delete a Flickr-album in Aperture and leave all images online? Thanks, Vincent

  • 3D applications in JAVA

    hello my problem is i am trying to make a 3D environment using pure java concepts, im a newbie to java and this is my college project......actually wat i exactly wanna know is.........how can a increase or decrease the size of an image without affect

  • Facing pages when Digital Publishing

    I used document setup to change a document's intent to Digital Publishing - the master still shows facing pages, which I think is not supposed to show when intent is set to digital publishing. Anybody seen this? Have a workaround.It's not a show-stop