In which cases does String.intern() increase the performance?

I'm optimizing my program and I wonder when I should use the String.intern() method to increase my performance. Is there a downside of using the intern() method?

paul.miner wrote:
kajbj wrote:
I have once implemented a system where intern was called on all strings when they arrived from a socket, and all comparisons was done using == after that. The reason was actually performance since we had to compare lots and lots of strings often. There is however a drawback with it. calling intern() when you have many strings in the pool is very slow (I would guess that it was linear time). You it's now always that you can improve performance by calling intern and comparing with ==Good point.
I think if I was in this position though, I'd create my own interned string pool instead of cluttering the one in String.We tried that as well. We pretty much did everything we could think of to reduce memory footprint while gaining execution time. Startup time was not of importance so it was not a problem that it took an hour to start the system.

Similar Messages

  • Urgent: regarding the increasing the performance of report

    Hi,
    I had a report which is displaying the correct data but i execute on PRD Server,it gets Request Time Out.So i want to increase the performance of it.Plzz help me out in doing this.
    REPORT  ZWIP_STOCK NO STANDARD PAGE HEADING LINE-SIZE 150.
    TABLES: AFPO, AFRU, MARA, MAKT.
    DATA: BEGIN OF ITAB OCCURS 0,
          AUFNR LIKE AFPO-AUFNR,
          MATNR LIKE AFPO-MATNR,
          LGORT LIKE AFPO-LGORT,
          MEINS LIKE MARA-MEINS,
          NTGEW LIKE MARA-NTGEW,
          MTART LIKE MARA-MTART,
          STOCK TYPE P LENGTH 10 DECIMALS 3,
          END OF ITAB.
    DATA : ITAB2 LIKE ITAB OCCURS 0 WITH HEADER LINE.
    DATA : DESC LIKE MAKT-MAKTX.
    SELECT-OPTIONS : MAT_TYPE FOR MARA-MTART.
    SELECT-OPTIONS : P_MATNR FOR AFPO-MATNR.
    DATA : V_MINOPR LIKE AFRU-VORNR,
           V_MAXOPR LIKE AFRU-VORNR,
           V_QTYMIN LIKE AFRU-GMNGA,
           V_QTYMAX LIKE AFRU-GMNGA,
           V_QTY TYPE P LENGTH 10 DECIMALS 3.
            SELECT AAUFNR AMATNR ALGORT BMEINS BNTGEW BMTART FROM AFPO AS A
              INNER JOIN MARA AS B ON AMATNR = BMATNR
                INTO TABLE ITAB WHERE ELIKZ <> 'X' AND MTART IN MAT_TYPE AND A~MATNR IN P_MATNR.
        ITAB2[] = ITAB[].
        SORT ITAB2 BY MATNR MEINS MTART NTGEW.
        DELETE ADJACENT DUPLICATES FROM ITAB2 COMPARING MATNR MEINS MTART NTGEW.
       LOOP AT ITAB2.
        V_QTY = 0.
          LOOP AT ITAB WHERE MATNR = ITAB2-MATNR.
            SELECT MIN( VORNR ) INTO V_MINOPR FROM AFRU WHERE AUFNR = ITAB-AUFNR.
            SELECT MAX( VORNR ) INTO V_MAXOPR FROM AFRU WHERE AUFNR = ITAB-AUFNR.
            SELECT SUM( GMNGA ) INTO V_QTYMIN FROM AFRU WHERE AUFNR = ITAB-AUFNR AND VORNR =  V_MINOPR.
            SELECT SUM( GMNGA ) INTO V_QTYMAX FROM AFRU WHERE AUFNR = ITAB-AUFNR AND VORNR =  V_MAXOPR.
            V_QTY = V_QTY + V_QTYMIN - V_QTYMAX.
          ENDLOOP.
          ITAB2-STOCK = V_QTY.
          MODIFY ITAB2.
        ENDLOOP.
        LOOP AT ITAB2.
              WRITE:/ ITAB2-MATNR,ITAB2-STOCK.
        ENDLOOP.

    Instead of code from
    itab2[] = itab[] till last endloop try code given below
    data : begin of minopr occurs 0,
           aufnr type afru-aurnr,
           vornr type afru-vornr,
           end of minopr.
    data : begin of maxopr occurs 0,
           aufnr type afru-aurnr,
           vornr type afru-vornr,
           end of maxopr.
    data : begin of qtymin occurs 0,
           aufnr type afru-aurnr,
           vornr type afru-vornr,
           end of qtymin.
    data : begin of qtymax occurs 0,
           aufnr type afru-aurnr,
           vornr type afru-vornr,
           end of qtymax.
    select aurnr vornr into table minopr from afru for all entries in itab where aurnr = itab-aufnr
    maxopr[] = minopr[].
    sort minopr by aufnr vornr ascending.
    sort maxopr by aufnr vornr descending.
    delete adjacent duplicates from minopr comparing aufnr.
    delete adjacent duplicates from maxopr comparing aufnr.
    SELECT aufnr vornr GMNGA INTO TABLE QTYMIN FROM AFRU for all entries in minopr WHERE AUFNR = minopr-AUFNR AND VORNR = MINOPR-vornr.
    SELECT aufnr vornr GMNGA INTO TABLE QTYMAX FROM AFRU for all entries in maxopr WHERE AUFNR = maxopr-AUFNR AND VORNR = maxopr-vornr.
    sort qtymin by aufnr.
    sort qtymax by aufnr
    sort itab by matnr MEINS MTART NTGEW.
    LOOP AT ITAB.
    v_minopr = 0.
    v_maxopr = 0.
    read table qtymin with key aufnr = itab-aufnr binary search.
    if sy-subrc = 0.
    loop at qtymin from sy-tabix.
    if qtymin-aufnr = itab-aufnr.
    V_MINOPR = V_MINOPR + itab-gmnga.
    else.
    exit.
    endif.
    endloop.
    endif.
    read table qtymax with key aufnr = itab-aufnr binary search.
    if sy-subrc = 0.
    loop at qtymax from sy-tabix.
    if qtymax-aufnr = itab-aufnr.
    V_MaxOPR = V_MaxOPR + itab-gmnga.
    else.
    exit.
    endif.
    endloop.
    endif.
    V_QTY = V_QTY + V_QTYMIN - V_QTYMAX.
    At new itab-matnr.
    if sy-tabix = 1.
    continue.
    endif.
    itab2 = itab.
    itab2-stock = v_qty.
    append itab2.
    V_QTY = 0.
    endat.
    ENDLOOP.
    itab2 = itab.
    itab2-stock = v_qty.
    append itab2.
    LOOP AT ITAB2.
    WRITE:/ ITAB2-MATNR,ITAB2-STOCK.
    ENDLOOP.

  • How to increase the performance in server 2008 R2 for RDP users

    Hi,
    My application take to much time to load. If anyone double click on mail client the exe file will appear in task manager but it will open after 5 mins. how to increase the performance.
    My sever configuration is as below,
    SC2600 Intel  motherboard with total 24 core processors and 32 GB RAM and 8 TB Hard Disk. RAID 5 is configured which has two lungs one is 167 GB for C drive and other is 4.5 TB for D drive.
    There are 28 Thin-clients connected to server through L300 N computing Thin-clients.
    Thin-clients connect to V-space server installed in server for RDP users to get connected.
    we have installed around 20 applications including printer and scanner driver. And apps are has below,
    Firefox browser, windows mail, Adobe acrobat XI, canon printer and scanner drivers, Epson printer and scanner driver, E scan anti-virus, office 2007, v space, power ISO, win-rar,Tally and e token drivers and some backup software's.
    Below  are the services and features enabled,
    AD, File services, RDP, web server, Hyper-v, .net frame work.
    Is there a way to increase the performance .
    Very slow performance.

    Hi,
    what would you suggest on  hardware configuration must be for  above mentioned applications and services with those many users.
    how many cores and ram size is required.

  • Increase the Performance of Search In Interactive Report

    Hi,
    I created a report which has about 10000+ records. To load the report it is not taking much time. But when i make a search in interactive report it is taking lot of time. Please suggest me how to increase the performance of interactive search.
    I am using Oracle apex 3.2 and Oracle 10g XE database.
    Please suggest me.
    Thanks
    Sudhir

    Hi,
    1) I am using Row Ranges Pagination from X to Y
    2) To Execute it takes about 1.15 seconds
    3) This is the function am using to make a call
    FUNCTION  FUNC_ORACLE_CONTRACT(P_SERIAL_NUMBER IN VARCHAR2,P_FLAG IN VARCHAR2) 
    RETURN VARCHAR2
    AS
    L_LOCATION_ID    NUMBER;
    L_SYSTEM_ID      VARCHAR2(200);
    L_ENTITLEMENT_ID VARCHAR2(200);
    L_CREATED_DATE   DATE;
    L_COMPANY_NAME   VARCHAR2(500);
    L_LEGAL_NAME     VARCHAR2(500);
           SELECT DISTINCT LOCATION_ID, SYSTEM_ID, ENTITLEMENT_ID, CREATED_DATE       
           FROM CUSTOMER_LICENSES
           WHERE PRODUCT_SERIAL_NUMBER = P_SERIAL_NUMBER OR
                 ENTITLEMENT_ID = P_SERIAL_NUMBER        OR
                 ACTIVATION_ID = P_SERIAL_NUMBER ;
    BEGIN
      OPEN C1;
      FETCH C1 INTO L_LOCATION_ID, L_SYSTEM_ID, L_ENTITLEMENT_ID, L_CREATED_DATE; 
        IF P_FLAG = 'COMPANY_ID' THEN
           SELECT COMPANY_NAME || ' (C)' INTO L_COMPANY_NAME
           FROM CUSTOMER_LOCATIONS
           WHERE LOCATION_ID = L_LOCATION_ID;
             IF L_COMPANY_NAME IS NULL THEN
                 SELECT LEGAL_NAME || ' (P)' INTO L_LEGAL_NAME
                 FROM PARTNER_LOCATIONS
                 WHERE ID = L_LOCATION_ID;
               RETURN L_LEGAL_NAME  ;
             ELSE
                RETURN L_COMPANY_NAME ;        
              END IF;
        ELSIF  P_FLAG = 'SYSTEM_ID' THEN
          RETURN L_SYSTEM_ID;
        ELSIF  P_FLAG = 'ENTITLEMENT_ID' THEN
          RETURN L_ENTITLEMENT_ID;
        ELSIF  P_FLAG = 'LOCATION_ID' THEN
          RETURN L_LOCATION_ID;   
       END IF;  
    CLOSE C1; 
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    RETURN NULL;
    WHEN OTHERS THEN
    RETURN NULL;
    END FNC_ORACLE_CONTRACTS;Edited by: Sudhir_Meru on Apr 9, 2013 4:11 PM

  • Increase the performance of fileadapter

    Hi,
    can any body tell me how to increase the performance of the FILEADAPTER & DBADAPTER?
    Regards,
    Krishna.

    As Anirudh has correctly stated you should upgrade if possible. In 10.1.3.1 the DB adapter had many issues, plus 10.1.3.1 was released 3 years ago so very old version.
    I would recommend upgrading or starting on 11.1.1.2 as there have been many improvement in the file and db adapters to manage large payloads. In 10.1.3.x you have limitations of 1MB in size before you need to start tuning or doing some advanced configuration.
    11g is the way forward, implemented using Oracle strategic application.
    cheers
    James

  • Increase the performance in webdynpro

    Hi,
    i am executing one report having huge data which is retrieving from SAP R/3 using RFC and display the data in portal using webdynpro the problem is if u execute this report using URL in internet site it is not displaying because of timeout exception (i think) how to increase the performance to execute that report with in the time for that request(but it is displaying the data if we execute the data in developement server but it takes lot of time )
    How to solve this issue?

    Hi we are using real time job .
    source : MDG [IDOCS]
    Transforms: Data Quality ,Address cleanse
    so here we want to increase the performance of the job ..
    so what are the performance tuning techniques for real time job ??
    This are the details related to job . please share your ideas

  • How to increase the performance of an insert query?

    Hi,
    I am using oracle database for our application where we executes one insert query and need the performance of 300 insert queries to be executed per second.
    As of now we are getting only 30/sec.We are not knowing how to tune the database for getting this performance.
    we are doing all this though C programming under both linux and solaris environment.
    Can u guide me in this issue.
    Regards,
    vamsi krishna

    Performance tuning issue is not something you can get a straight forward answer for.
    You need to look at various aspects of the system to get close to or increase the performance of your application. Tuning just the database might not give you want you want.
    So, you need to look at the Application codes, Mermory, Disk IO, etc. Have a look at the Performance Tuning Guide from the Oracle Documentation Library for your Oracle Release and Operating System
    http://www.oracle.com/technology/documentation/index.html#previous

  • How to increase the performance of a domain index?

    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    I am using a dynamic query which uses a domain index for a clob column. The table has 1021487 records. How can i increase the performance of a select query based on this table? This is the only part where my application gets slowed down.
    The query is
    SELECT :search_id, 100, :item_type, c.search_college, c.search_colname, TRUNC(dbms_random.value(900000000000, 999999999999)) rand, COUNT(1), c.college_rating, min(DECODE(c.search_postcode, NULL, 99999, NULL)) search_distance FROM w_search_text c WHERE c.search_course_type is not null
    and (contains(c.search_text,:search_text,2) > 0)
    AND c.search_item_type = :item_bind
    GROUP BY c.search_college, c.search_colname, c.college_rating
    ORDER BY c.search_college
    here c.search_text is the domain indexed column?
    Is there a way to tune it?
    Ram

    Here c.search_text is the clob column.
    i am using 4 bind variables and they are search id : 123456
    item_type : O
    search_text : French
    item_bind : Z
    I tried explain plan and here are the results
    Plan
    SELECT STATEMENT ALL_ROWSCost: 5 Bytes: 38,280 Cardinality: 264                
         3 SORT GROUP BY Cost: 5 Bytes: 38,280 Cardinality: 264           
              2 TABLE ACCESS BY INDEX ROWID TABLE HOT_ADMIN.W_SEARCH_TEXT_LIVE2 Cost: 4 Bytes: 38,280 Cardinality: 264      
                   1 DOMAIN INDEX INDEX (DOMAIN) HOT_ADMIN.W_SRCH_TXT_IDX2 Cost: 4
    Its using the domain index, But the column is highly fed up with data...so ithink that may be the reason.Is there any HINTS in particular to tune domain indexes?
    Ram

  • How to increase the performance of a report

    can any body tell me how to increase the performance of a report?////
    i have prepared a report to show the expense detail .I have used BSIS and BSAS table.
    But whenever I am executing it is facing runtime error (TIME_OUT error ).
    Moderator Message: Duplicate Post. Read my comments in your previous thread.
    Edited by: kishan P on Nov 25, 2010 1:38 PM

    Please SEARCH in SCN before posting.
    Also post performance related issues here.

  • How to increase the performance of a program

    How to increase the performance of a program.
    Regards
    Lisa
    Message was edited by: Lisa Roy

    Here are some links that may help.
    http://www.sapinsideronline.com/searchspi/search.htm?page=article&key=20297&query_text=performance%7Ctuning
    http://www.sapinsideronline.com/searchspi/search.htm?page=article&key=44221&query_text=performance%7Ctuning

  • How to increase the performance of  Weblogic server 7.0?

    How to increase the performance of Weblogic server 7.0 ?
    also, how do i avoid typing the server login and password evertime I start the
    webserver?

    How to increase the performance of Weblogic server 7.0 ?It depends on what is not running fast enough for you.
    also, how do i avoid typing the server login and password evertime I
    start the webserver?In the startWebLogic shell script (.cmd or .sh) add:
    set WLS_USER=weblogic
    set WLS_PW=password
    (Replace "password" with whatever your password is.)
    Peace,
    Cameron Purdy
    Tangosol, Inc.
    http://www.tangosol.com/coherence.jsp
    Tangosol Coherence: Clustered Replicated Cache for Weblogic
    "winston" <[email protected]> wrote in message
    news:3fe42d33$[email protected]..
    >

  • Increase the Performance of a package while execution

    Hi,
    i am using oracle 9i and linux..
    in my pl/sql if i executed a particular package it will take 5 min.
    please explain how to increase the performance of the package
    how to extract the query from the package and
    how to build an explain plan..
    and how to tune the query
    Regards

    If you wanna test pl/sql, sql profiler is a good way to test.
    You can always use 10046 event to trace the queries in the package. Take their explain plan and see if there is any room for tune.
    affar

  • Increasing the performance of the abap program

    Hi ,
    Anybody had any document regarding how to increase the performance of ABAP program.
    Regards,
    baiju

    hi,
      Refer This link.
    <b>
    Performance tuning for Data Selection Statement</b> 
    http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
    <b>
    1.     Debugger</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617ca9e68c11d2b2ab080009b43351/content.htm
    http://www.cba.nau.edu/haney-j/CIS497/Assignments/Debugging.doc
    http://help.sap.com/saphelp_erp2005/helpdata/en/b3/d322540c3beb4ba53795784eebb680/frameset.htm
    <b>2. Run Time Analyser</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/c6/617cafe68c11d2b2ab080009b43351/content.htm
    <b>3. SQL trace</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/801f7c454211d189710000e8322d00/content.htm
    <b>4. CATT - Computer Aided Testing Too</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/b3/410b37233f7c6fe10000009b38f936/frameset.htm
    <b>
    5. Test Workbench</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/a8/157235d0fa8742e10000009b38f889/frameset.htm
    <b>
    6. Coverage Analyser</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/c7/af9a79061a11d4b3d4080009b43351/content.htm
    <b>
    7. Runtime Monitor</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/b5/fa121cc15911d5993d00508b6b8b11/content.htm
    <b>
    8. Memory Inspector</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/a2/e5fc84cc87964cb2c29f584152d74e/content.htm
    <b>9. ECATT - Extended Computer Aided testing tool.</b>
    http://help.sap.com/saphelp_47x200/helpdata/en/20/e81c3b84e65e7be10000000a11402f/frameset.htm

  • HT1473 I am a songwriter and new at this.  Can I upload my work for sale on Itune and does Itune interact with the Performing Arts organization?

    I am a songwriter and want to upload my work to itune but I need a few question cleared up.
    1.     Does Itune interact with the Performing Arts organization such as BMI in order for artist to be paid or do i just set up a paypal account and pay artist myself?
    2.     What percentage of sales does itune take or is it a flat rate?
    3.     When i upload does itune give me an option to set price for my work.?

    TownSquareTheMusic wrote:
    I am a songwriter and want to upload my work to itune but I need a few question cleared up.
    1.     Does Itune interact with the Performing Arts organization such as BMI in order for artist to be paid or do i just set up a paypal account and pay artist myself?
    2.     What percentage of sales does itune take or is it a flat rate?
    3.     When i upload does itune give me an option to set price for my work.?
    Town Square,
    In addition to the iTunes Store, you may wish to check out some of the online stores that may be a bit more flexible for artists just starting to sell online:
    NoiseTrade
    BandCamp

  • How to increase the performance of an Application

    Hi,
    I am using jdeveloper11.1.1.2.0 and weblogic server10.3.2.I have lot of txn in the database.when click the txn menu then page landing is very slow.My Txn data is 24thousands records.
    My RAM is 8GB and 64bit machine .So how to fast my application?Is any idea then Please help me.
    Thanks
    Anup

    Hi Frank,
    I have follow the below link but there is no performance effect of my application.
    http://www.gebs.ro/blog/oracle/adf-view-object-performance-tuning-analysis/
    On VO level ,In Tuning
    I have modified In batch Of 26 ,As needed ,and Query Optimizer hints FIRST_ROWS_26
    AND ON the page level ,Table Column Property,Fetch size i have modified 26 and page definition level ExchangeTradedPlacementHeadVOIterator default range size is 25.
    So i have above change but there is no effect on the performance of my application.
    Please give me the Solution what will i do to increase the performance of an application.
    Thanks
    Anup

Maybe you are looking for

  • HOW DO I LOAD MOVIES(BESIDES ITUNES STORE STUFF) ONTO MY IPOD

    I figured out that by buying this particular program online, I could use it to convert most movie file formats to ipod movie files, but the process is time consuming, slow, and unreliable sometimes in terms of the fidelity of the final product versus

  • Select count(Key_Field) from table_name never returns

    I am doing some scalability tests and am building a db w/table that will contain 400Million records. I am trying to see how far along I am in the process, and am experiencing this problem. The select count(ID) never returns. Does anyone have any sugg

  • Updating the PO

    Hi All,      when we save the transaction QM02, we need to update the PO, based on status of the Notification Number. status is not available  in any  userexit/BADI. How can i resolve the problem?. is it possible to trigger the custom program, when t

  • Rich Client

    Can I force my users to run the Rich Client thru infoview?  I don't want to run around to all my users and create ODBC entries. Any advance would be appreciated.

  • Mac Mini will NOT Load

    Hello Happy Mac People. I am currently having issues with my Mac Mini. Currently, in it's Superdrive Slot rests a disc that was meant to install a Microsoft Keyboard and Mouse combo that was wireless. I know what you are going to say. Microsoft equip