Any performance overhead if we get iterator over values stored in map

Hi Everybody,
Is there any performance overhead if we get iterator over values stored in map. like this
Iterator itr = rolesMap.values().iterator();
if yes please explain...thanks in advance.

ejp wrote:
That's rather out of date. It is how Hashtable works, but as regards HashMap it isn't. The keySet() iterator and the values() iterator are both written in terms of the entrySet() iterator. There is no skipping over unused slots.Out of date? In that case there's been a recent advance in hashed data structures I've missed.
Or the HashMap implementation has been recently changed to internally link entries to improve iteration performance. I doubt that because such a list would degrade the performance of the HashMap in other ways and that's unacceptable (and unnecessary because of LinkedHashMap).
Besides, what I said is in the Java 6 API documentation to LinkedHashMap. It may be out of date but I doubt it.
So here we are with a fact of nature: Any iteration of a hash based data structure will be proportional to capacity rather than the number of entries, unless a supportive list style data structure is introduced to overcome this.

Similar Messages

  • Any Pointers on how to get object list values and component values in iw32

    Hi,
    I have a requirement where whenever a user enters a creates(iw31) or changes(iw32) an order then we have to validate the materials entered by the user before saving the order.We have en interface structure for the transaction 'CAUFVD'.Which gives us the values of functional location and equipment entered under the Reference object.But we need to validate all the object list functional locations and also Order components enetered by the user.Can any one tell me how to get the values of all these fields entered by the user?
    And also I need to query Equipment Bill of Material.What does this equipment BOM refers to .Is it the equipments under Object list or something else.
    Please Help.
    Thanks

    Hi Anu
    There is a user exit that gets trigerred when you try to save a work order . The exit is 'EXIT_SAPLCOIH_009' . This exit has the structure CAUFVD_IMP which will give you all the order header values entered by the user.
    User exit 'EXIT_SAPLCOBT_001' will give all the values entered by the user including order components. Also check the package CO  amd see if there is any other function group suiting your requirement.
    hope this helps you.
    cheers
    shivika

  • Iterator over a hash table map

    How can I implement an iterator method ( public Iterator keyIterator() { }
    ) so that it would iterate over the key in a hash table map data structure. Thanks

    Map has a method called ketSet. Read it's docs. It's a Set. Set has iterator().
    There's also entrySet() and values().
    Read their docs and see which one works best for you.
    You may also want to check out this tutorial:
    http://java.sun.com/docs/books/tutorial/collections/

  • TXDataSource performance overhead ?

    Hi,
    I want to know if it is okay to use TXDataSource for non transactional purposes,
    like for simple queries etc...
    Do I need to have two Data sources, A normal DataSource for non transactional purpose
    and a TXDataSource for transactional purposes.
    Is there any performance overhead because of using TXDataSource ?
    Thanks,
    Sudhir

    Sudhir Babu wrote:
    Hi,
    I want to know if it is okay to use TXDataSource for non transactional purposes,
    like for simple queries etc...
    Do I need to have two Data sources, A normal DataSource for non transactional purpose
    and a TXDataSource for transactional purposes.
    Is there any performance overhead because of using TXDataSource ?
    Thanks,
    SudhirHi. Feel free to use a TxDataSource. There is no appreciable overhead. In fact, the TxDataSource
    will detect whether it's in an ongoing transaction, and if not, it immediately goes to the pool
    driver for the connection to return, just like a plain data source, so after you get the connection,
    the performance/behavior is identical (in the non-transactional condition).
    Joe

  • Any function module to get Stock and value of material on a given date?

    Hi Friends
    Is there any function module available to get Stock/and  value of material on a given date?
    Thanks
    Harish

    Sorry I didn't elaborate the requirement.
    I am asked to develop a custom report for inventory management. For range of materials it is required to display stock and value on particular date and GRs GIs for the range.
    I need function module to use in Zreport.
    Thanks
    Harish

  • (1) Is there any way that I can get the transition menu to remain on the screen. I select a transition, drag it to the timeline and after I click done I have to start the process all over to perform this action on the next transition. I have premiere elem

    (1) Is there any way that I can get the transition menu to remain on the screen. I select a transition, drag it to the timeline and after I click done I have to start the process all over to perform this action on the next transition. I have premiere elements 12. In older version the menu would stay on the screen.
    (2) In pan and zoom how can start zoom on a photo in the original picture and zoom in and the next picture zoom out and the next photo pan from right to left and the next photo pan left to right.
    Thanks
    Sam

    TidyCup
    What computer operating system is your Premiere Elements 12 running on? If you have not already, be sure to update 12 to 12.1, using an opened project's Help Menu/Update.
    But to the immediate questions, assuming Windows 7, 8, or 8.1 64 bit....
    1. No, it is what it is. But, are you applying the same transition each time? If so, then highlight/select all the clips involved (all at one time), then Timeline Menu/Apply Default Transition will do just that for the highlighted/selected clips.
    To highlight/select more than one clip at a time, hold down the Shift key of the computer main keyboard and then click on each clip that you want in the group selection
    or
    with your mouse cursor draw a rectangle around the clips that you want to select
    2. Are you using the Premiere Elements 12/12.1 Expert workspace Pan and Zoom Tool? Or the pan or zoom presets under fx Effects/Presets/? With those you can do pan or zoom, not pan and zoom.
    Or, are you in the Elements Organizer 12 Slideshow Editor using the pan and zoom effect there? Or, are you using keyframing the Motion Scale property for zoom and the Motion Position property for pan?
    Are you asking about photos with landscape or portrait orientation?
    The pan and zoom tool does one photo at a time.
    Have you read the Adobe documentation on the Pan and Zoom Tool?
    http://help.adobe.com/en_US/premiereelements/using/WSeffff8bffc802084-494411db12fd35452dd- 8000.html
    Please review and clarify and then we can get into greater details on this.
    Thanks.
    ATR

  • I have an I phone 3g and I downloaded the newest software and I can't get any music to play.  I can't change my playlists and the songs I have on the phone just get skipped over.  What can I do to correct this?

    I have an I phone 3g and I downloaded the newest software and I can't get any music to play.  I can't change my playlists and the songs I have on the phone just get skipped over.  What can I do to correct this?

    it recognizes the iPOD but I can't get any of the new songs to import to the iPOD
    are you getting an error message, Odessa? if so, what does it say? include error message numbers if you're getting any.
    if you're not getting an error message, describe what happens when you try to transfer songs to the ipod as best you can.

  • I have downloded ITunes to a new laptop and signed in this let's me download previous purchases in to the librery but can't get the films I have bought quite a lot over time any idea how I can get them ???

    I have downloded ITunes to a new laptop and signed in this let's me download previous purchases in to the librery but can't get the films I have bought quite a lot over time any idea how I can get them ???

    You cannot.
    You buy one and only one download of movies.  it is your responsibility to backup your purchases.
    Copy everything from your old computer or your backup copy of your old computer to your new one.

  • Getting a iterator over a huge xml-file

    Hi !
    I have to persist data from some huge xml-files.
    The structure of the xml is simple, like in:
    <items>
    <item>
    </item>
    <item>
    </item>
    </items>
    The best way for me, is to get an iterator over the item-elements represented as a DOM strcture for easy access.
    Because the files are so huge (80-150 MBytes) and I have no control over the creation of them, the underlying parser should be SAX oriented.
    So I need a solution which will parse until one item-element (maybe spezified through a XPATH query) is completed and build a DOM-tree from it.
    Then I can pass this DOM-element to my persistence layer. When this item is persisted, and the Iterator hasNext(), then I could do a simple .next() to get the next DOM representation of the item.
    Is there such a solution out ? Or do I have to 'invent' such kind of parsing ?
    Would by great to get some hints ... this problem is driving me crazy :)
    Thank you in advance,
    Gerald

    Vaguely familiar, http://lists.xml.org/archives/xml-dev/200201/msg00032.html
    I can't think of a DOM builder that would work off a fragment; you would probably have to create one yourself.
    There's also http://drizzle.stanford.edu/~peastman/pax.html which might solve your problem.
    Pete

  • I have an iphone 4S and it is within the warranty period. However my power button is jammed. Will i get an over the counter replacement in any store in the USA?

    I am currently situated in India and they have a messed up replacement policy but, if i send my phone with the bill and everything will i get an over the counter replacement? The phone was bought in August 2012 and the power button jammed in November 2012. Also, does Apple only replace the phone or the earphones and everything that comes with it?

    You will have to physically take the iPhone to an Apple store in the US,
    if that is where it was purchased. If you are not going to be in the US, send
    it to a friend or relative there to take into Apple for you, and then that person
    can ship it back to you - shipping costs and insurance are your responsibility.
    Apple does not accept international shipments for replacement nor will Apple
    ship a replacement out of the country where replacement is made. Only your
    iPhone - if determined to be defective - will be replaced, and your iPhone is all
    you need to take to Apple.
    iPhone warranty is valid only in country of original purchase - it has always been
    this way for iPhones. The replacement policy is not messed up - it is working as
    designed. Apple India would not have the correct handset to replace the one you
    purchased in the US.

  • Link aggregation - performance overhead?

    Does anybody know if Solaris link aggregation incurs any performance degredation compared with non-redundant network connections?
    We've recently upgraded a client system and have enabled link aggregation to bind two interfaces (bge) to a logical aggregated interface.
    Apart from the server hardware upgrade, which brought a change from ce to bge interfaces, this is the only other significant network change.
    On this heavily used system, database network performance has degraded significantly, and being the only significant network change I'm wondering whether link aggregation could be a cause.
    Reading through Sunsolve articles and man pages, there doesn't appear to be anything categorically stating aggregation imposes a cost overhead.
    However, I'd be interested to hear from others if they've experienced this.
    For what it's worth, this is Solaris 10 10/09 on an Ultrasparc VII.

    So many considerations when you talk about performance: what system hardware in use? how many interfaces? is this a CoolThreads "T" server (where single threaded programs don't run as well as multi-threaded); what do you mean by "database network performance has degraded"; does the DB need to be tuned or adjusted for this? If using add-on cards, are they in the most optimal slot (some platforms) and don't go over the recommended # of interface boards supported by the system? different storage array or config for you DB?
    when cases like these come in, there typically is a discussion that needs to take place around those questions as well as what/when/where and expectations like those described here: http://blogs.sun.com/hippy/entry/what_s_the_answer_to
    also understand that link aggregation does not necessarily mean that you will see a balancing of the load evenly b/t 2 or more aggregated interfaces. The default policy is "L4" which decides the outbound interface by TCP and UDP info if found in the packet, not by simple source/destination or mac address hashing, although you can set those with -P if you want. You can also set multiple policies. (-P L2,L3).
    So it /could/ be related to the aggregation change you made, but you also upgraded this DB machine from some other system, so there ARE other differences. Were you using link aggregation on the previous system or Sun Trunking? What type of CPU was that other system?
    that's all I can think of, but hopefully you get the idea.

  • OSB - Iterating over large XML files with content streaming

    Hi @ll
    I have to iterate over all item in large XML files and insert into a oracle database.
    The file is about 200 MB and contains around 500'000, and I am using OSB 10gR3.
    The XML structure is something like this:
    <allItems>
    <item>.....</item>
    <item>.....</item>
    <item>.....</item>
    <item>.....</item>
    <item>.....</item>
    </allItems>
    Actually I thought about using a proxy service with enabled content streaming and a "for each" action for iterating
    over all items. But for this the whole XML structure has to be materialized into a variable otherwise it is not possible!
    More about streaming large files can be found here:
    [http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/context.html#large_messages]
    There is written "When you enable streaming for large message processing, you cannot use the ... for each...".
    And for accessing single items you should should use an assign action with a xpath like "$body/allItems/item[1]";
    this works fine and not the whole XML stream has to be materialized.
    So my idea was to use the "for each" action and processing seqeuntially all items with a xpath like:
    $body/allItems/item[$counter]
    But the "for each" action just allows iterating over a sequence of xml items by defining an selection xpath
    and the variable that contains all items. I would like to have a "repeat until" construct that iterates as long
    $body/allItems/item[$counter] returns not null. Or can I use the "for each" action differently?
    Does the OSB provides any other iterating mechanism? I know there is this spli-join construct that supports
    different looping techniques, but as far I know it does not support content streaming, is this correct?
    Did I miss somehting?
    Thanks a lot for helping!
    Cheers
    Dani
    Edited by: user10095731 on 29.07.2009 06:41

    Hi Dani,
    Yes, according to me this would be the best approach. You can use content-streaming to pass this large xml to ejb and once it passes successfully EJB should operate on this. If you want any result back (for further routing), you can get it back from EJB.
    EJB gives you power of java to process this file and from java perspective 150 MB is not a very LARGE data. Ensure that you are using buffering. Check out this link for an explanation on Java IO Streams and, in particular, buffered streams -
    http://java.sun.com/developer/technicalArticles/Streams/ProgIOStreams/
    Try dom4J with xpp (XML Pull Parser) parser in case you have parsing requirement. We had worked with 1.2GB file using this technique.
    Regards,
    Anuj

  • Getting a DataReader by stored procedure vs. SQL statment (Performance)

    Hallo DB-Experts,
    I have encountered a performance problem regarding getting a DataReader by stored procedure versus a SQL statment
    and I want to know if this is an known issue and how to tune it.
    Getting a DataReader through a SQL statment is faster than with a stored procedure,
    if the number of data rows are less than about 8000 datarows, although we are using an index.
    The stored procedure ist only faster about 8000 datarows.
    For the first 20 rows the different is between 50 abd 20 percent and between and 20 and 2000 rows it fall down to 10 percent.
    Over 8000 rows the stored procedure is faster!
    The time series table looks like:
    CREATE TABLE TimeSeries
    OBJECT_ID NUMBER(8) NOT NULL,
    UNIVERSAL_TIME NUMBER(10) NOT NULL,
    LOCAL_TIME DATE NOT NULL,
    MOD_TIME NUMBER(10),
    USERID NUMBER(10),
    VALUE NUMBER NOT NULL,
    FLAG NUMBER(2) DEFAULT 0 NOT NULL
    The foreinkey is object_id and another index is for universal_time and mod_time
    The stored procedure looks like:
    PROCEDURE SELECTDATA_UT_MOD (pObjectID IN NUMBER,
    pType IN VARCHAR2,
    pTable IN VARCHAR2,
    pFrom IN NUMBER,
    pTo IN NUMBER,
    IO_CURSOR OUT T_CURSOR)
    IS
    SQLString VARCHAR2(1024);
    BEGIN
    IF pOBJECTID <> 0 THEN
    CASE
    WHEN UPPER(pTYPE)='A' THEN
    SQLString := 'SELECT UNIVERSAL_TIME, VALUE, FLAG, MOD_TIME FROM ' || pTABLE || ' WHERE OBJECT_ID = :t1 AND UNIVERSAL_TIME >= :t2 and UNIVERSAL_TIME < :t3 Order By UNIVERSAL_TIME, MOD_TIME DESC';
    OPEN IO_CURSOR FOR
    SQLString USING pOBJECTID,pFROM,pTO;
    END IF;
    END;
    The SQL statment for the data reader looks like:
    SELECT d.universal_time, d.VALUE, d.flag, 0 AS mod_time
    FROM daten d
    WHERE object_id = 18465
    AND d.universal_time >= 3600
    AND d.universal_time < 28803600
    ORDER BY d.universal_time, mod_time DESC
    Do you have any idea or tip why the sql statment for the first 8000 rows is faster than the stored procedure?
    Many thanks in advance and
    Best regards
    George
    Edited by: hakomdba on 09.01.2009 06:39

    Hallo DB-Experts,
    I have encountered a performance problem regarding getting a DataReader by stored procedure versus a SQL statment
    and I want to know if this is an known issue and how to tune it.
    Getting a DataReader through a SQL statment is faster than with a stored procedure,
    if the number of data rows are less than about 8000 datarows, although we are using an index.
    The stored procedure ist only faster about 8000 datarows.
    For the first 20 rows the different is between 50 abd 20 percent and between and 20 and 2000 rows it fall down to 10 percent.
    Over 8000 rows the stored procedure is faster!
    The time series table looks like:
    CREATE TABLE TimeSeries
    OBJECT_ID NUMBER(8) NOT NULL,
    UNIVERSAL_TIME NUMBER(10) NOT NULL,
    LOCAL_TIME DATE NOT NULL,
    MOD_TIME NUMBER(10),
    USERID NUMBER(10),
    VALUE NUMBER NOT NULL,
    FLAG NUMBER(2) DEFAULT 0 NOT NULL
    The foreinkey is object_id and another index is for universal_time and mod_time
    The stored procedure looks like:
    PROCEDURE SELECTDATA_UT_MOD (pObjectID IN NUMBER,
    pType IN VARCHAR2,
    pTable IN VARCHAR2,
    pFrom IN NUMBER,
    pTo IN NUMBER,
    IO_CURSOR OUT T_CURSOR)
    IS
    SQLString VARCHAR2(1024);
    BEGIN
    IF pOBJECTID <> 0 THEN
    CASE
    WHEN UPPER(pTYPE)='A' THEN
    SQLString := 'SELECT UNIVERSAL_TIME, VALUE, FLAG, MOD_TIME FROM ' || pTABLE || ' WHERE OBJECT_ID = :t1 AND UNIVERSAL_TIME >= :t2 and UNIVERSAL_TIME < :t3 Order By UNIVERSAL_TIME, MOD_TIME DESC';
    OPEN IO_CURSOR FOR
    SQLString USING pOBJECTID,pFROM,pTO;
    END IF;
    END;
    The SQL statment for the data reader looks like:
    SELECT d.universal_time, d.VALUE, d.flag, 0 AS mod_time
    FROM daten d
    WHERE object_id = 18465
    AND d.universal_time >= 3600
    AND d.universal_time < 28803600
    ORDER BY d.universal_time, mod_time DESC
    Do you have any idea or tip why the sql statment for the first 8000 rows is faster than the stored procedure?
    Many thanks in advance and
    Best regards
    George
    Edited by: hakomdba on 09.01.2009 06:39

  • When I switch my time capsule to 5.0ghz mode the range of my wireless network drops significantly.  Near the Time Capsule my Macbook Pro works fine, in my bedroom I have almost no signal.  In mixed mode it works fine.  Any ideas on how to get 5.0 working?

    When I switch my time capsule to 5.0ghz mode the range of my wireless network drops significantly.  Near the Time Capsule my Macbook Pro works fine, in my bedroom I have almost no signal.  In mixed mode it works fine both placed.  Any ideas on how to get 5.0 working?  I thought 5.0Ghz was supposed to have a wider range.  Do I need to change a setting on the Macbook Pro?
    Thanks, W

    I'm not sure if you understand that 5 GHz has some upsides, but also some very significant downsides.
    The upside is that the 5 GHz signal will allow faster speeds.
    The downside is that you must always give up something in order to gain something else.Unfortunately, the marketing hype about 5 GHz does not go into very many details about this.
    In the case of 5 GHz, the 5 GHz signals are much weaker than 2.4 GHz signals, so they do not travel as far or penetrate any obstructions like walls or ceilings nearly as well as 2.4 GHz signals. In many cases, in order to get good 5 Ghz performance, you literally have to have almost a line-of-sight relationship between your computer and the wireless router.
    If you have a new dual band router, which broadcasts both a 2.4 GHz and 5 GHz signal simutaneously, your Mac will connect to the best signal quality automatically depending on its location in relation to the router. In the same room, without any obstructions, it will connec to 5 GHz. But, take the laptop down the hall a few rooms and around the corner and the Mac will connect to the 2.4 GHz signal because at that location, the 2.4 GHz signal is not only stronger, it is also faster.

  • I spilled water on my laptop and my "i", "j" and "k" letters don't work on my laptop. However my main problem is that my password contains an "i" so i am locked out of my computer. Any ideas how I can get around the password and login.

    I spilled water on my laptop and my "i", "j" and "k" letters don't work on my laptop. However my main problem is that my password contains an "i" so i am locked out of my computer. Any ideas how I can get around the password and login. I tried the method where you go into single user mode and type in commands, however that method uses some of the letters that are not working on my laptop.

    You didn't mention which version of OS X your running but there are password reset utilities provided OS X: Changing or resetting an account password (Snow Leopard and earlier) - Apple Support  or  OS X: Changing or resetting an account password - Apple Support
    Alternately you can use an external keyboard to log in and change the password. Make a backup if you don't have one, it's likely that your problems aren't over. If that water continues to migrate downward and fries the logic board your macbook will be toast.

Maybe you are looking for

  • Look& fill is not right in IE and Chrome for OAF page

    hi all, I have some doubts: 1.I have added one custom RN to one oracle standard page. it is working fine in Google Chrome browser but the look & fill is not coming right in IE. 2. I have 4 dropdown lists in my RN, when i will select any values from t

  • Problems with tablesalignment (from Word to PDF)

    Hello, Ive downloaded the trialversion of Acrobat because our company needs to make little pdf's out of 40/50 documents and i want to try what program is best for our... The thing is: i just cant get the tables right (sry for my bad english ) This pr

  • If i need 2 send an Object that allready exist like Image .....

    Hi Folks , i need an Advise to my problems. My problems is like that I need 2 send an Object a lot of times throw the Soket for this i need packing my Objects and send them 1 after 1 i will try say more clearly i need 2 send a lot of Frames (Image Ca

  • Error in Personalized view in Buyer work bench

    Hi, We created for one user a personalized view in the buyer workbench on the requisition tab. Now we get an error: The value Cazabat, Maurice specified for the item ResultsTable.SuggestedBuyerId is an invalid number. And we are unable to create any

  • ERROR: You do not have enough privileges to add this item.

    On any new web App Items , or any new Web Apps created getting the message when attempting to do update (logged in as user and can access the item in edit) ERROR: You do not have enough privileges to add this item. The same user id can do updates to