How is the performance for HashMap.get()

hi all
i just want to ask you guys how quick the hashmap.get() runs for a given key, if there are thousand of entries in the hashmap. thanks

If you want to know how something is going to perform, write a tiny program and test it. Either put it on a profiler, or just put time markers around a big loop. Here's something that somebody (UJ, I think) came up with recently for comparing casting vs. toString after extracting from a Map. It should be easy to adapt to just the Map.get() timing. In fact, I think I added a chunk to do just that, as a control. Knock yourself out. import java.util.*;
public class MapTiming {
    Random rnd = new Random(13L);
    public static void main(String[] args) {
        int numEntries = Integer.parseInt(args[0]);
        Integer key = Integer.valueOf(args[1]);
        new MapTiming().zillion2(numEntries, key);
    void zillion2(int numEntries, Integer key) {
        HashMap map = new HashMap();
        int ix;
        for (ix = 0; ix < numEntries; ix++) {
            int entry = rnd.nextInt();
            map.put(new Integer(entry), String.valueOf(ix));
        map.put(key, String.valueOf(ix));
        final int LOOPS = 10000000;
        final int TIMES = 5;
        long time;
        for (int j=0; j<TIMES; j++) {
            time = System.currentTimeMillis();
            for (int i=0;i<LOOPS; i++) {
                String item = map.get(key).toString();
            System.out.println("toString= " + (System.currentTimeMillis()-time));
        for (int j=0; j<TIMES; j++) {
            time = System.currentTimeMillis();
            for (int i=0;i<LOOPS; i++) {
                String item = (String)map.get(key);
            System.out.println("cast= " + (System.currentTimeMillis()-time));
        for (int j=0; j<TIMES; j++) {
            time = System.currentTimeMillis();
            for (int i=0;i<LOOPS; i++) {
                Object obj = map.get(key);
            System.out.println("get= " + (System.currentTimeMillis()-time));
        for (int j=0; j<TIMES; j++) {
            time = System.currentTimeMillis();
            for (int i=0;i<LOOPS; i++) {
                String item = map.get(key).toString();
            System.out.println("toString= " + (System.currentTimeMillis()-time));
        for (int j=0; j<TIMES; j++) {
            time = System.currentTimeMillis();
            for (int i=0;i<LOOPS; i++) {
                String item = (String)map.get(key);
            System.out.println("cast= " + (System.currentTimeMillis()-time));
        for (int j=0; j<TIMES; j++) {
            time = System.currentTimeMillis();
            for (int i=0;i<LOOPS; i++) {
                Object obj = map.get(key);
            System.out.println("get= " + (System.currentTimeMillis()-time));
}

Similar Messages

  • How is the value for ETL_PROC_WID getting populated in W_ETL_LOAD_DATES

    Hello,
    Can you please let me know how the ETL_PROC_WID variable works in ODI with regard to the W_ETL_LOAD_DATES. I see my W_ETL_LOAD_DATES_LOG is having 0/1 everytime. Can someone please help me to understand how this 0/1 is populated. Also, if I want the value in the variable to be always 1 what needs to done.
    Thanks and regards !!

    From the BIAPPS documentation: ETL_PROC_WID This column is the unique identifier for the specific ETL process used to create or update this data.
    Given this description the value should be unique for every execution of an ODI integration process. If you want to see the logic behind the variable, either navigate to the ODI Console or ODI Studio connect to the BIApps ODI repository and take a look at the variable setup. 

  • How to improve the performance for integrating third party search engine

    hi,
    I have been working on integrating verity search engine with KM. the performance for retrieving search result totally depend on how many search result returned, for example if there is less than 10 records, it only takes 3 seconds, but if there are 200 records, it takes about 3 minutes, is it normal? anyway to improve it? Thanks!
    T.J.

    Thilo,
    thanks for the response, would you recommend some document for configuring KM cache service, I did change memory cache, and also dynamic web reposity, whatelse out there that I can change? right now, I have one instance(EP6.4 sp11) works well, it returns 200 records from Stellent within 6s. But when I put this KM global service on EP6.0 sp2 (our current system) it takes about 15s. I am not sure is this because of different EP version, or something else. I have tried my best to slim down SOAP component from Stellent. I don't think anything else can be done from that side anymore. before I changed the SOAP, it tooks about 60s. just wonder what else I can do on KM side to improve it performance? Thanks!
    T.J.

  • How is the performance of Mac Pro if i use it as host for windows and linux virtual machines.

    How is the performance of Mac Pro if i use it as host for windows and linux virtual machines.
    I am planning to buy a high performance PC to run my Windows and Linux servers as vitrual machines for my testing purposes.
    Initially i planned to build my own computer with recommended configurations but considering space constaints and cooling factors i think Mac Pro can be a choice. But need some inputs if Mac pro (Intel Xeon E5, 12 GB RAM) is good for running virtual Machines.

    You could even run Windows natively and still run your VM servers.
    I have seen reports and such on MacRumors and elsewhere - run Windows natively as well as VMs (can also do testing and run Mavericks in a VM under Mavericks)
    The fast internal PCIe-SSD, plus 6 or 8 cores, and 32-64GB RAM. Of course for $5,000 for 8-core, some Thunderbolt storage and 32GB/64GB RAM you can buy some serious hardware.

  • How to check performance for Stored procedure or Package.

    Hi ,
    Can any one please tell me , how to check performance for Stored procedure or Function or Package
    Thanks&Regards,
    Sanjeev.

    user13483989 wrote:
    Hi ,
    Can any one please tell me , how to check performance for Stored procedure or Function or Package
    Thanks&Regards,
    Sanjeev.Oracle has provided set of Tools to monitor the Performance.
    Profilers being one of them; If you wish to understand more on PL/SQL Optimization, please read PL/SQL Optimization and Tuning.
    See example of DBMS_PROFILER.
    See example of PLSQL Hierarchial Profiler

  • How is the iphone4s working. iam getting one tmr

    How is the iphone4s working. iam getting one tmr

    Except for an extremely small number, they work fine. You'll see tomorrow.

  • ADF 10g on JBOSS, how is the performance & stability ?

    Hi All,
    We are considering to use JBOSS for our ADF 10g APplication, has anybody here using it ? how is the performance & stability ?
    Thank you,
    xtanto

    think it's this one New beta bios for s939 K8N Neo2 Platinum added (7025NMS.151) see syar's comment in next post.
    If there are any more recent betas than that try them, the link to syar's d/load page is in thread.
    don't know - check the threads
    don't think so - check the threads
    luck

  • Everything you love, everywhere you go.... How in the freek do I get there???

    as a recent (6+ years ago) convert from pc to mac, the most recent upgrade to ios8 has left serious question about the direction of apple.
    "everything you love, everywhere you go". Sounds great, but, how in the freek do I get there. After upgrading my imac to ios8 then being informed that i cant upgrade my iphone because it hasn't yet been synced with icloud and it has all of a sudden become difficult to compose this comment because my imac touch pad no longer responds as delicately as it did before the latest ios upgrade, heck, even spel chek doesnt siem ta werk aniemor. regretfully its all becoming more pc-ish.
    if you bother to advise me that it is better to do an action another way, please help me through the 'better' way.
    where are the 'simple' steps to sync my imac with my iphone with my macbook, with my ipad with my icloud?????
    You are not allowed to create or update this content
    ¢∞£™¶¶∞£™¢∞§¶§¶•oops
    oh my

    Maybe you could try clicking the "Contact Us" link at the top of the Verizon website to get the following information.
    Customer Service
    (800) 922-0204
    or dial *611 from your mobile phone
    View the *611 On-Screen App for Android Video
    6:00am - 11:00pm Monday-Sunday
    Emergency Service Hours
    11:00pm - 6am Monday-Sunday

  • How is the performance maxtor 300gb 16mb sata on neo2 k8n?

    How is the performance maxtor 300gb 16mb sata on neo2 k8n? what bios should i use for this and does sata 3&4 port work with the oc speed over 240?
    do i have to update to sp2 to detect all the space?

    think it's this one New beta bios for s939 K8N Neo2 Platinum added (7025NMS.151) see syar's comment in next post.
    If there are any more recent betas than that try them, the link to syar's d/load page is in thread.
    don't know - check the threads
    don't think so - check the threads
    luck

  • Gnome-shell with nouveau - how is the performance

    I have an old 8400GS and find gnome-shell's performance under nouveau pretty bad.  Is it my card or the driver?  If you have a more powerful card, how is the performance?  I'm no gamer but is there a more powerful (none fan cooled) nvidia card that's better?

    Looks okay.... guess my 8400GS is just underpowered for this driver.  I ordered the 450 GTS so we'll see
    $ grep flip /var/log/Xorg.0.log
    [ 23641.419] (==) NOUVEAU(0): Page flipping enabled
    $ grep drm /var/log/Xorg.0.log
    [ 23641.418] drmOpenDevice: node name is /dev/dri/card0
    [ 23641.418] drmOpenDevice: open result is 7, (OK)
    [ 23641.418] drmOpenByBusid: Searching for BusID pci:0000:01:00.0
    [ 23641.418] drmOpenDevice: node name is /dev/dri/card0
    [ 23641.418] drmOpenDevice: open result is 7, (OK)
    [ 23641.419] drmOpenByBusid: drmOpenMinor returns 7
    [ 23641.419] drmOpenByBusid: drmGetBusid reports pci:0000:01:00.0
    [ 23641.419] (II) [drm] nouveau interface version: 0.0.16
    [ 23641.419] drmOpenDevice: node name is /dev/dri/card0
    [ 23641.419] drmOpenDevice: open result is 8, (OK)
    [ 23641.419] drmOpenDevice: node name is /dev/dri/card0
    [ 23641.419] drmOpenDevice: open result is 8, (OK)
    [ 23641.419] drmOpenByBusid: Searching for BusID pci:0000:01:00.0
    [ 23641.419] drmOpenDevice: node name is /dev/dri/card0
    [ 23641.419] drmOpenDevice: open result is 8, (OK)
    [ 23641.419] drmOpenByBusid: drmOpenMinor returns 8
    [ 23641.419] drmOpenByBusid: drmGetBusid reports pci:0000:01:00.0
    [ 23641.419] (II) [drm] DRM interface version 1.4
    [ 23641.419] (II) [drm] DRM open master succeeded.
    $ dmesg | grep drm
    [ 0.651085] [drm] Initialized drm 1.1.0 20060810
    [ 0.661177] [drm] nouveau 0000:01:00.0: Detected an NV50 generation card (0x298200a2)
    [ 0.664916] [drm] nouveau 0000:01:00.0: Attempting to load BIOS image from PRAMIN
    [ 0.710278] [drm] nouveau 0000:01:00.0: ... appears to be valid
    [ 0.710280] [drm] nouveau 0000:01:00.0: BIT BIOS found
    [ 0.710281] [drm] nouveau 0000:01:00.0: Bios version 62.98.47.00
    [ 0.710283] [drm] nouveau 0000:01:00.0: TMDS table version 2.0
    [ 0.710284] [drm] nouveau 0000:01:00.0: Found Display Configuration Block version 4.0
    [ 0.710286] [drm] nouveau 0000:01:00.0: Raw DCB entry 0: 02000300 00000028
    [ 0.710287] [drm] nouveau 0000:01:00.0: Raw DCB entry 1: 01000302 00020030
    [ 0.710289] [drm] nouveau 0000:01:00.0: Raw DCB entry 2: 04011310 00000028
    [ 0.710290] [drm] nouveau 0000:01:00.0: Raw DCB entry 3: 010223f1 00c0c080
    [ 0.710292] [drm] nouveau 0000:01:00.0: DCB connector table: VHER 0x40 5 16 4
    [ 0.710294] [drm] nouveau 0000:01:00.0: 0: 0x00001030: type 0x30 idx 0 tag 0x07
    [ 0.710296] [drm] nouveau 0000:01:00.0: 1: 0x00000200: type 0x00 idx 1 tag 0xff
    [ 0.710297] [drm] nouveau 0000:01:00.0: 2: 0x00000110: type 0x10 idx 2 tag 0xff
    [ 0.710299] [drm] nouveau 0000:01:00.0: 3: 0x00000111: type 0x11 idx 3 tag 0xff
    [ 0.710300] [drm] nouveau 0000:01:00.0: 4: 0x00000113: type 0x13 idx 4 tag 0xff
    [ 0.710303] [drm] nouveau 0000:01:00.0: Parsing VBIOS init table 0 at offset 0xD710
    [ 0.735573] [drm] nouveau 0000:01:00.0: Parsing VBIOS init table 1 at offset 0xDAB5
    [ 0.741906] [drm] nouveau 0000:01:00.0: Parsing VBIOS init table 2 at offset 0xE364
    [ 0.741911] [drm] nouveau 0000:01:00.0: Parsing VBIOS init table 3 at offset 0xE456
    [ 0.742976] [drm] nouveau 0000:01:00.0: Parsing VBIOS init table 4 at offset 0xE655
    [ 0.742977] [drm] nouveau 0000:01:00.0: Parsing VBIOS init table at offset 0xE6BA
    [ 0.762981] [drm] nouveau 0000:01:00.0: 0xE6BA: Condition still not met after 20ms, skipping following opcodes
    [ 0.762989] [drm] nouveau 0000:01:00.0: timingset 255 does not exist
    [ 1.160045] [drm] nouveau 0000:01:00.0: 1 available performance level(s)
    [ 1.160047] [drm] nouveau 0000:01:00.0: 3: memory 400MHz core 567MHz shader 1400MHz fanspeed 100%
    [ 1.160055] [drm] nouveau 0000:01:00.0: Register 0x00004030 not found in PLL limits table
    [ 1.160090] [drm] nouveau 0000:01:00.0: c: memory 399MHz core 566MHz shader 1400MHz
    [ 1.160209] [drm] nouveau 0000:01:00.0: Detected 512MiB VRAM
    [ 1.161277] [drm] nouveau 0000:01:00.0: 512 MiB GART (aperture)
    [ 1.173455] [drm] nouveau 0000:01:00.0: DCB encoder 1 unknown
    [ 1.173457] [drm] nouveau 0000:01:00.0: TV-1 has no encoders, removing
    [ 1.174154] [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
    [ 1.174155] [drm] No driver support for vblank timestamp query.
    [ 1.428713] [drm] nouveau 0000:01:00.0: allocated 1920x1080 fb: 0x40000000, bo ffff880221feec00
    [ 1.483825] drm: registered panic notifier
    [ 1.483828] [drm] Initialized nouveau 0.0.16 20090420 for 0000:01:00.0 on minor 0

  • How is the password for RemoteApp RDSAdmin user?

    Hello
    I want to Publishing an application but required a user with administrator rights. how is the password for RemoteApp RDSAdmin user?

    Hi Gilberto,
    If you want to publish a custom application, you need to add it to an image and upload the template. The link below explains how to create the custom template:
    How to create a custom template image for RemoteApp
    http://azure.microsoft.com/en-us/documentation/articles/remoteapp-create-custom-image/
    Thanks,
    -Raul

  • Anyone help? I click on buttons within websites and my mac opens new webpages advertising, mac keeper pro or some foreign exchange trading platform. Did i pick something hop in a download? how do i search for and get rid of this annoying infiltration?

    Anyone help? I click on buttons within websites and my mac opens new webpages advertising, mac keeper pro or some foreign exchange trading platform. Did i pick something hop in a download? how do i search for and get rid of this annoying infiltration?

    You've installed some form of adware. Take a look here:  http://www.thesafemac.com/arg/

  • HT1443 how in the heck do i get OS 6?

    how in the heck do i get OS 6?

    If you have a PowerPC Mac, you don't.
    If you have an Intel Mac, phone the online Apple Store and order a Mac OS X 10.6 DVD.
    (71032)

  • Nvidia 5200, how is the performance?

    Currently, I have a Radeon 9500 Pro video card, and no matter which driver I use (catalyst or open source), it freezes my computer dead.  In Ubuntu this really only happened when I did something with OpenGL (even glxgears) but since I've switched to Arch it has happened even while loading KDE.  Right now, I don't even have a xorg.conf file because that's the only way I can get my computer to load a GUI (I'm guessing that it is defaulting to using vesa drivers?)
    The point is that my friend is bringing me an Nvidia 5200 video card and I'm going to use that, but I'm wondering how the performance is.  I'm pretty sure it's gonna render things faster than my vesa'd 9500 Pro, but I know that my video card is actually much faster if I could ever have gotten it to work properly.  Does the 5200 support compositing, for example, without being slow?  Is having a slow video card going to hurt me in someway (I do OpenGL programming, but only small things).  Also, my current card is hooked up to my LCD via DVI, but the 5200 only has VGA outputs; how much of a degrade in quality will I see on my LCD?
    Thanks for the help.

    Alot of people on the forums seem to be having trouble with ATI cards recently so I'm glad I bought an nvidia card to replace an old ATI Rage card awhile ago.  Apparently nvidia and linux are a tad more friendly with each other.  I certainly had no problems setting up my card.  The 5200 is a little older than my 6200 and I'm not sure what effect the vga out is going to have but I'm sure you'll be happy with the nvidia card.
    After a recent nvidia driver upgrade I had to switch back to the nvidia-96xx driver for games to work properly so I'd say that you most likely will not be able to run the latest nvidia driver.

  • How come the driver for the validiy sensor has an older version but newer release date

    Can someone please explain why the driver for the finger print reader has an older date but a newer version?
    The one on HPs website := Driver Version 4.4.234.0 and Driver Date 24/09/2012.
    Yet the one on my P.C. := Driver Version 4.5.235.0 and Driver Date 22/07/2009.
    Is it worth updating or not?
    I can't seem to get the add-on working on I.E. 11.0.3
    Any advice appreciated.

    Spyke,
    Welcome to the HP Forum.
    Short Answer: 
    If you are running the same version of the Operating System that you were running when the driver was installed, then it is likely your driver is fine as it is.
    Based on your Example:
    If you have upgraded your Operating System, and you are using Windows 8 or Windows 8.1 AND your system is among those supported by the "newer" driver, then you should upgrade.
    Long Answer:
    There are several Validity Sensor Drivers of this same revision - in the case of sp58869 , the driver has been issued as a compatible driver for the HP Envy M6 for both Windows 8 and Windows 8.1.   The change might have required additional supporting libraries used with the driver and did not require changes to the driver software itself.
    You didn't say which computer model you have nor the version of Windows you are running.
    It is true the specific driver within the version class might make a difference if you have updated your Operating System since your own driver was issued for your computer.
    It is true that reinstalling a "same version" driver can help if the driver on your system is corrupted.  Driver corruption is normal to some extent -- leave a driver on a Windows computer long enough and one or two of the zillions of instructions can corrupt, links can be lost; data can become unstable due to library changes or registry errors.
    Drivers control hardware.  The fingerprint driver only controls the fingerprinter.
    Software provides a means for the user to interact with the computer in an organized environment.
    ==================================================​=========================================
    Sometimes a perfectly good driver can "look bad" -- certain data persists from boot to boot.  This is normal and the fact that some data is immediately available at boot means the computer starts up faster and that the Operating System is available sooner to the user of the computer.
    When things in the boot-to-boot instruction set get tangled, then things may stop working:  TouchPad, mouse (external), fingerprint software, maybe even the keyboard.  The login data profile for the user account may not set up properly.
    Driver Reset / Clean-the-cobwebs off the computer:
    Close all your programs and Shut down the computer
    Disconnect everything (little Unifier for the keyboard / external mouse can stay)
    Perform the Hard Reset for your notebook
    Boot the computer and log in
    Next...
    If Internet Explorer 11 is a recent update from a previous version, and even if this is not an upgraded IE issue, it is important that you be running the most recent version of your fingerprint Software.
    I am assuming a lot here -- including that you are running HP SimplePass Version 6.x.
    Continuing that line of thought; you might find the following useful:
    Simple Instructions to Upgrade HP SimplePass
    Brilliant Post - How to Ask Your Question
    Click the Kudos Thumbs-Up!
    It is a nice way to say “Thank You”.
    Although I strive to reflect HP's best practices, I do not work for HP. 
    Kind Regards,
    Dragon-Fur

Maybe you are looking for

  • Problem in deleting records in DB2

    From session bean method i have called DAO & Entity Bean to delete from some tables in DB2. But it is throwing Deadlock or Timeout exception and got rolledback. What could be the reason. When i comment out DAO part it is working fine. Is there any re

  • Suddenly my MacBook Air is very slow to boot up. I'm running Mac OS X Lion 10.7.5 (11G63). Any tips? Thanks!

    Suddenly my MacBook Air is very slow to boot up. It's about a year and a half old. I'm running Mac OS X Lion 10.7.5 (11G63) -- and I'm far from being an expert at any of this stuff, have seen a few different answers and not sure what to do. Help! Gra

  • All My Apple Apps won't launch - my others like Firefox, Adobe CS do????

    I have a 512meg G4 iMac with around 7gig HD space free. All my Apple programs refuse to launch, or launch and then hang (apart from iDVD). I though of setting up a new user but as soon as I click on Users in Prefs its the spinning beachball of death.

  • Problem in Initialization Parameter file...Oracle10g

    Hi all, I am working in oracle 10g.I created a pfile from an exiting spfile and changed the Processes parameter and then again created a spfile from this changed pfile. Didnt delete the previous spfile and bounced the database. At startup I encounter

  • HTML to Flash linking

    Hi all, Maybe can someone help me with this. I have a webpage that is done in HTML. I need the links to direct into another site that is done in flash. The links from the HTML have to direct into particular movie clips in flash. Anyone know how to do