Profiling and performance optimization

This subject realy sucks in the CLDC/j2me world. Profiling in the emulator is useless, and on the device, you simply can't do it. System.currentTimeMillis() might give you some hits, but is the overhead of printing this (in my case to a comm port) is to large for the testet function, you are out of options... What to do then?
Well, with this topic, I would like to ask for some help om the possibilities of profiling j2me devices.
I'm currently working on a compression algorithm te compress log data. I found one that doesn't use a lot of memory and managed to incorporate it in my CLDC programme: ( It uses Arithmatic compression, got it from http://www.mandala.co.uk/biac/index.html ).
The problem is: Althouth the source is very compact and fairly simple, it still is very slow om my device (they claim it can do about 700 lines of java code/sec, but I think it is a bit more).
Solution: optimize, but how if you don't know where to start? Well, the algorithm is simple enough to have a look at it, and optimize by trail and error... luckilly I remenberd some things I leaned on a cource about image manipulation (in C).
So, next is a list of simple things you can do to to optimze your code, in sections where every byte of code executed is crucial:
- try to find out what code is executed often or takes a lot of time; look at loops and calculations.
- instead of x*2 use x<<1, instead of x/2 use x>>1, etc.
- try to manually unroll loops (you might first try out how often the loop runs to test who for to unroll it
- if the same calculation is used more than ones, just caclulate the value ones, and then just use that value in the other calculations in stread of caclulating it over and over. If those values are static, declare them static.
- if possible manually inline short functions. You might even use a preprocessor (in cobination with ant or somthing) and use macro's
- simplt try to do more with less code
- if you often devide though a fixed number, try to multiply with the inverted (thisis not always possible in j2me because only integer math is available). This is faster on most devices.
- Use array's if you have to acces lare amounts of data. Vectors and such are much slower.
- Use compiler and obfuscator to optimize and shrink your code.
Most of them are very obvious, but often you just forget about it.
Well, all in all, my compression algorithm got at fair bit faster, but it is still to slow. I guess I'm going to tweak it a little more ;)
Hope you guys can do something with it. If you have some more tips, just let me know!

Good day,
As I tried, there are two ways of doing printPreview.
To handle this problem, add only one page at a time.
To browse through the page use Prev Page, Nexe Page buttons in the toolbar.
1) BufferedImage - occupies memory .
Class PagePreview extends JPanel
public void paint(Graphics g) {
g.setColor(getBackground());
g.fillRect(0, 0, getWidth(), getHeight());
g.drawImage(m_img, 0, 0, this);
paintBorder(g);
This gives better performance, but consumes memory.
2) getPageGraphics in the preview panel . This occupies less memory, but re-paint the graphics everytime when paint(Graphics g) is called.
Class PagePreview extends JPanel
public void paint(Graphics g)
g.setColor(Color.white);
RepaintManager currentManager = RepaintManager.currentManager(this);
currentManager.setDoubleBufferingEnabled(false);
Graphics2D g2 = scrollPanel.getPageGraphics();
currentManager.setDoubleBufferingEnabled(true);
g2.dispose();
This addresses memory problem, but performance is better.
Is there any additional info from you?
Good Luck,
Kind Regards,
Krish

Similar Messages

  • Printing memory and performance optimization

    Hello,
    I am using JVM 1.3 for a big Java Application.
    Print Preview consumes 1.5MB of JVM's memory and performance is slow.
    Please give your valuable ways to reduce memory usage and performance improvement
    will be appreciated.
    /* print method in ScrollablePanel extends JPanel */
         public int print(Graphics g, PageFormat pf, int pi) throws PrinterException
              double pageHeight = 0;
              double pageWidth = 0;
              Graphics2D g2 = (Graphics2D)g;
              pageWidth = pf.getImageableWidth();
              if (pi >= pagecount)
                   return Printable.NO_SUCH_PAGE;
              g2.translate(pf.getImageableX(),pf.getImageableY());
    // < Print Height manipultion>
              g2.setClip(0,(int)(startHeight[pi]), (int) pageWidth, (int)(endHeight[pi] - startHeight[pi]) );
              g2.scale(scaleX,scaleX);
              this.print(g2);
              g2.dispose();
              System.gc();
              return PAGE_EXISTS;
    /* print preview */
    private void pagePreview()
    BufferedImage img = new BufferedImage(m_wPage, m_hPage, BufferedImage.TYPE_INT_ARGB);
    Graphics g = img.getGraphics();
    g.setColor(Color.white);
    g.fillRect(0, 0, m_wPage, m_hPage);
    target.print(g, pageFormat, pageIndex);
    pp = new PagePreview(w, h, img); // pp is JPanel
    g.dispose();
    img.flush();
    m_preview = new PreviewContainer(); //m_preview is JPanel
    m_preview.add(pp);
    ps = new JScrollPane(m_preview);
    getContentPane().add(ps, BorderLayout.CENTER);
    Best Regards,
    Krish

    Good day,
    As I tried, there are two ways of doing printPreview.
    To handle this problem, add only one page at a time.
    To browse through the page use Prev Page, Nexe Page buttons in the toolbar.
    1) BufferedImage - occupies memory .
    Class PagePreview extends JPanel
    public void paint(Graphics g) {
    g.setColor(getBackground());
    g.fillRect(0, 0, getWidth(), getHeight());
    g.drawImage(m_img, 0, 0, this);
    paintBorder(g);
    This gives better performance, but consumes memory.
    2) getPageGraphics in the preview panel . This occupies less memory, but re-paint the graphics everytime when paint(Graphics g) is called.
    Class PagePreview extends JPanel
    public void paint(Graphics g)
    g.setColor(Color.white);
    RepaintManager currentManager = RepaintManager.currentManager(this);
    currentManager.setDoubleBufferingEnabled(false);
    Graphics2D g2 = scrollPanel.getPageGraphics();
    currentManager.setDoubleBufferingEnabled(true);
    g2.dispose();
    This addresses memory problem, but performance is better.
    Is there any additional info from you?
    Good Luck,
    Kind Regards,
    Krish

  • Infocube line item dimension and performance optimization

    Hi,
    I remodelled an infocube and line item dimension contains only one characteristics set as line item dimension.
    previously the dimension as one characteristics but it wasn't set as line item dimension.
    and when I checked the SAP_INFOCUBE_DESIGNS from SE38  it looks ok.
    /SAP/CUBE   /SAP/CUBE3   rows:        8663  ratio:          3  %
    After setting it as line item the rows is now minus but it is showing red which means that there is problem with the dimension
    /SAP/CUBE   /SAP/CUBE3   rows:          1-   ratio:          0  %
    Its this a performance problem since it is showing red.
    thanks

    hi,
    No,its not performance issue.
    for a dimension to be line item dimension...the dimension size shouldn't be more than 20% size of the fact table size.
    when a dimension is set as line item dimension,the regarding SID will be placed in Fact Table,but not the DIM ID.
    may be that is the reason when your dimension is not line item dimension,it shows the number of rows and when it is made line item dimension,its not showing any rows and the ratio also null.
    hope this is clear for you.
    Regards
    Ramsunder

  • Coherence Best Practices and Performance

    I'm starting to use coherence and I'd to know if someone could point me out some doc on Best Practices and Performance optimizations when using it.
    BTW, I haven't had the time to go through the entire Oracle documentation.
    Regards

    Hi
    If you are new to Coherence (or even for people who are not that new) one of the best things you can do is read this book http://www.packtpub.com/oracle-coherence-35/book I know it says Coherence 3.5 and we are currently on 3.7 but it is still very relevant.
    You don't need to go through all the documentation but at least try the introductions and try out some of the examples. You need to know the basics otherwise it makes it harder for people to either understand what you want or give you detailed enough answers to questions.
    For performance optimizations it depends a lot on your use cases and what you are doing; there are a number of things you can do with Coherence to help performance but as with anything there are trade-offs. Coherence on the server-side is a Java process and often when tuning, sorting out issues and performance I spend a lot of time with the usual tools for Java such as VisualVM (or JConsole), tuning GC, looking at thread dumps and stack traces.
    Finally, there are plenty of people on these forums happy to answer your questions in return for a few forum points, so just ask.
    JK

  • How can I optimize my hard disk drive usage and performance in Windows 8 or Windows 7?

    QuestionHow can I optimize my hard disk drive usage and performance in Windows 8 or Windows 7?
    AnswerThere are a few simple steps you can take to ensure your hard disk drive is used optimally.
    Use Toshiba HDD Protection
    Many Toshiba laptops come with a program called Toshiba HDD Protection pre-installed. This program helps to protect your hard disk drive from being damaged due to falls or impacts. By default, it should already be enabled. You might be tempted to lower the detection levels in this application, but doing so could cause your hard disk drive to be damaged. Remember that while the application can reduce the chance of damage, you should still avoid allowing the laptop to fall or suffer rapid impacts.
    For more information on this utility, see the following article:
    TOSHIBA HDD Protection
    Optimize the drive
    Windows 8 and Windows 7 optimize hard disk drives automatically through a process called defragmentation. Unless you've disabled this, you don't need to do anything. If you have disabled this and want to run the process, you can still do so.
    In Windows 8, search for "Defrag" at the Windows Start screen and select "Defragment and optimize your drives."
    In Windows 7, search for "Defrag" in the Start Menu's search field and select "Disk defragmenter."
    You can use this tool to optimize your hard disk drives, allowing Windows to find needed files faster.
    Remove items from startup
    Some applications run automatically when Windows starts. This can add additional functionality, but it also decreases the performance of your computer. Sometimes you might want to disable certain programs from starting automatically.
    In Windows 8, search for "Task Manager" at the Start screen. Select the "Startup" tab. Select an application you'd like to disable from starting automatically and then click the "Disable" button in the lower-right.
    In Windows 7, type "msconfig" in the Start Menu's search field and press ENTER. Uncheck the boxes next to applications you'd like to disable from starting automatically.
    You should be sure of the purpose of an application before disabling it from starting automatically. Some applications might be important. If in doubt, you might consider searching on the Web to discover more information about a program. Remember that if you find that you disabled something vital, you can always re-enable it.
    For more information, please see the following video:

    QuestionHow can I optimize my hard disk drive usage and performance in Windows 8 or Windows 7?
    AnswerThere are a few simple steps you can take to ensure your hard disk drive is used optimally.
    Use Toshiba HDD Protection
    Many Toshiba laptops come with a program called Toshiba HDD Protection pre-installed. This program helps to protect your hard disk drive from being damaged due to falls or impacts. By default, it should already be enabled. You might be tempted to lower the detection levels in this application, but doing so could cause your hard disk drive to be damaged. Remember that while the application can reduce the chance of damage, you should still avoid allowing the laptop to fall or suffer rapid impacts.
    For more information on this utility, see the following article:
    TOSHIBA HDD Protection
    Optimize the drive
    Windows 8 and Windows 7 optimize hard disk drives automatically through a process called defragmentation. Unless you've disabled this, you don't need to do anything. If you have disabled this and want to run the process, you can still do so.
    In Windows 8, search for "Defrag" at the Windows Start screen and select "Defragment and optimize your drives."
    In Windows 7, search for "Defrag" in the Start Menu's search field and select "Disk defragmenter."
    You can use this tool to optimize your hard disk drives, allowing Windows to find needed files faster.
    Remove items from startup
    Some applications run automatically when Windows starts. This can add additional functionality, but it also decreases the performance of your computer. Sometimes you might want to disable certain programs from starting automatically.
    In Windows 8, search for "Task Manager" at the Start screen. Select the "Startup" tab. Select an application you'd like to disable from starting automatically and then click the "Disable" button in the lower-right.
    In Windows 7, type "msconfig" in the Start Menu's search field and press ENTER. Uncheck the boxes next to applications you'd like to disable from starting automatically.
    You should be sure of the purpose of an application before disabling it from starting automatically. Some applications might be important. If in doubt, you might consider searching on the Web to discover more information about a program. Remember that if you find that you disabled something vital, you can always re-enable it.
    For more information, please see the following video:

  • Regarding performance optimization and tuning...

    hi all,
    <b>please provide me the performance tuning scenarios and parameters of an R/3 system with Oracle..</b>
    i heartly welcome all docs and pdf links or notes related to this issue..
    please provide ur suggestions at the earliest...
    expecting ur response..
    <i>Vineeth</i>

    Hello,
    there are many SAP Notes regarding performance issues. Here are just a couple of them:
    618868
    805934
    793113
    805934
    Please also have a look at the lists of the relating Notes at the end of each Note.
    But still much more effective would be to read the book of
    <a href="http://www.sap-press.de/katalog/buecher/titel/gp/titelID-1155?GalileoSession=66220888A2.lRCIISlE">T.Schneider Performance Optimization Guide</a>.
    It's the best performance tuning guide. The course ADM315 (or BC315?) ist also very helpful.
    Regards,
    Natalia

  • After latest update (today), Firefox continually crashes. How can I uninstall this latest update? Tried creating new profiles and they also crash.

    Firefox worked earlier today (August 19, 2013 about 6:30 pm EDT). When I opened Firefix after 9pm EDT, Firefox attempted to perform an update. No error was given, but now Firefox will not start. Running a Windows 8 machine with all updates and current security software with no known malware on my system.
    When I try to start Firefox, the system shows the "working" circle, but then nothing. I created a new profile, and got Firefox to start, but whenever I try to go to any website, Firefox crashes.
    Last 2 crash reports from today:
    InstallTime20130814063812 (contents: 1376962029)
    LastCrash (contents: 1376969373)

    If you have submitted crash reports then please post the IDs of one or more recent crash reports that have a "bp-" prefix:
    *bp-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    You can find the IDs of the submitted crash reports on the <i>about:crashes</i> page.
    *You can open the <b>about:crashes</b> page via the location bar, like you open a website, or open the crash reports page via "Help > Troubleshooting Information".
    See:
    *http://kb.mozillazine.org/Mozilla_Crash_Reporter
    *https://support.mozilla.org/kb/Mozilla+Crash+Reporter
    Try to start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window.
    You can use one of these to start Firefox in <u>Safe Mode</u>:
    *On Windows, hold down the Shift key while starting Firefox with a double-click on the Firefox desktop shortcut
    *On Mac, hold down the Options key while starting Firefox
    *Help > Restart with Add-ons Disabled
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Firefox V33.0 can't find user profile and cant view window content

    Hello
    I have used Firefox since the old days, wayyy back. Never an issue, always worked, always performed.
    My Firefox (v32 I believe), automatically downloaded and applied the v33 browser and immediately, everything went wrong...
    First, the browser loaded but the screen was either sheet black or sheet white, then reloading (after closing the window) was informed (only via the window title as all else was block black) that Firefox couldn't see a user profile.
    I loaded FF with safe mode and disabled everything (list of addons at the bottom of this post), and the browser loads now and I can see content, but then after only a minute in "safe mode" firefox persistently returned with either a fatal crash or a sudden inability to find the user profile (causing exit).
    Reading up about possible workarounds, I eventually managed to export the Profile data (to desktop), to clear the profile data and replace data with desktop copy. Clearing the data took several attempts due to firefox display only showing black or white as stated above, but firefox then couldn't "import" profile as I can't see whats going on in the window.
    Eventually manually installed profile data (from desktop automatic copy) to firefox but FF still persisted in crashing to desktop and not displaying correctly if not in Safe mode. I eventually uninstalled firefox and reinstalled from scratch. The reinstall persisted with all the above mentioned issues, I did manually reinstate the FF user profile and crashing to desktop is now rare but does still happen, now it usually happens when Firefox is not the current active window.
    Firefox still does not display correctly unless in the "Safe Mode".
    Any clues or help or suggestion about why this would happen? Any way I can revert to version 32?
    My Addons :
    No Services.
    Appearance, default only
    PLUGINS:
    VLC plugin 2.1.3.0
    Silverlight plugin 5.1.3
    shockwave flash 15.0.0
    Quicktime plugin 7.7.5
    Java platform SE7 U67 10.
    Google Update (disabled)
    Adobe Acrobat 11.0.9
    EXTENSIONS:
    British Dictionary (not compatible with v33!!, disabled)
    Colorzilla 2.8.1
    cssUpdater 0.5.2 (disabled)
    Dust-Me Selector [for CSS] 4.1
    Firebug 2.0.3 (and associated FireDiff, FirePHP, EventBug)
    enabling / disabling all/any of these does not (so far) change the graphical fault loading Firefox outside of Safe Mode.
    Any ideas?
    cheers
    P.S>As additional info: I have tried the "reset firefox" but this caused numerous little bugs with saving the profile user data. Also reseting did not fix any of the issues.
    Everything else on my computer works fine. No virus, no malware (Eset / MWBytes) all other programs fine, and FF was fine until V33!!

    Hi for the crashes that are continuing, we're sorry to hear that Firefox is crashing. In order to assist you better, please follow the steps below to provide us crash IDs to help us learn more about your crash.
    #Enter ''about:crashes'' in the Firefox address bar and press Enter. A Submitted Crash Reports list will appear, similar to the one shown below.
    #Copy the '''5''' most recent Report IDs that start with '''bp-''' and then go back to your forum question and paste that into the "Post a Reply" box. (Please don't take a screenshot of your crashes, just copy and paste the ID's. The below image is just an example of what your Firefox screen should look like)
    [[Image:aboutcrashesFx29|width=520]]
    <br><br>
    Thank you for your help!
    More information and further troubleshooting steps can be found in the [[Firefox crashes - Troubleshoot, prevent and get help fixing crashes]] article.

  • Performance optimization related.

    Hi.
    I am doing Performance optimization on code.
    Actually, I am doing performance optimization for old code where it is of JDK1.4 related. I met up with a doubt when I optimize code for JDK1.5.
    Problem statement:
    Collection errors = new ArrayList();
                errors.add(new GenericException(ErrorCodes.EMPLOYEE_INVALID_PERMISSION));
                setErrorsInRequest(request, errors);In the above code the compiler tells us to Parameterize the Collection type reference. If we don't make any parameterization for Collection type, will that be dealing with Performace issue?
    Please help me out to resolve the problem statement.
    Thanks and regards,
    Leslie V
    www.googlestepper.blogspot.com
    www.scrollnroll.blogspot.com

    If we don't make any parameterization for Collection type, will that be dealing with Performace issue?No. Not really. But performance isn't really the issue... it's runtime-type-safety which is at issue. There's nothing to prevent me from adding an Integer (like an error number) to your collection of exceptions.
    And "GenericException"... Sheesh, come down from the trees allready. WTF am I (the user of this class/method/package) supposed to with a friggin "GenericException"... you may as well have thrown a raw RuntimeException and saved all that cumbersom interveening try/catch code.

  • Partner Profile and its configuration.

    Hi all,
    I am creating an SD IDoc using EDI and send it between two servers.
    I need to know what is a partner profile and why should we create it.
    what are the steps to be followed in maintaining a partner profile and its configuration.
    Any pointers will be highly apppreciated.
    Thanks in advance,
    Regards,
    Jose
    Edited by: Jose Anthony Reddy on Dec 17, 2007 11:23 PM

    Hi Jose,
    Below is a material you can go through .
    Creating an Outbound Partner Profile
    Here you must enter the data manually. Alternatively, you can also transfer the default values from Customizing.
    If you are not yet on the change screen of your desired partner, choose SAP Menu ® Tools ® IDoc Interface/ALE ® Administration ® Runtime Settings ® Partner Agreement (WE20).
    1. Position the mouse on your partner in the required partner type node. Choose in the Outbound Parameter table.
    Key Fields
    2. You have already determined partner number and partner type in general partner processing. The partner function from the master data defines the addressee, that is, it is used for further classification purposes. If you have selected outbound processing under Message Control (MC), the function must be identical to the corresponding Message Control field. Otherwise, it is optional.
    Partner A (customer 1110) wants to order a material from partner B (vendor 1014). Partner B is of the partner type “LI” (vendor) and must choose the Message Control value “VD” (vendor) as the partner function because orders must always be processed using Message Control.
    3. Specify the business process with the “logical” message, within which the IDoc type is used. The logical message is described by three parameters: The message type is based on EDIFACT message types: For example, a purchase order is of type “ORDERS”. You can further divide the message type with the optional fields message code and message function.
    4. Configure the test indicator if you want to send the message as a test.
    Message, partner and test indicator are the seven key fields of the outbound partner profiles (the client comes in addition to these). Also see the graphic at the end of this section.
    Other Fields
    5. In the Outbound options tab page, you can determine whether IDocs are forwarded immediately to the receiving system. You should ensure that your entries are compatible with the Message Control priorities, if you have chosen outbound processing under Message Control. A list of recommended combinations is provided in the section Outbound Processing Under MC: Procedure.
    6. You have already defined the Recipient port in Port definition.
    7. If a port of type TRFC is used, the Queue Processing field is visible. You can use the indicator to specify whether IDocs are to be sent with qRFC. This sending technique is only possible for recipient SAP systems as of SAP Web AS 6.20.
    You should only set this flag if it is really necessary that the IDocs sent are received in the receiving system in the same sequence as they were sent by the sender system. Queuing can cause posting delays in the receiving system, because an IDoc in the queue cannot be posted. In this case, the following IDocs in the queue cannot be posted until the error is resolved.
    8. If you have set the Queue Processing indicator, the Rule Name field, which you must then also maintain, appears as well. The rule name defines the rules for queue names. You can specify these rules in the transaction qRFC IDoc Queue Name Rules (WE85).
    9. Specify the IDoc type as the Basic type with or without extension. If you want to use a view of your IDoc type (for example, to improve the performance), specify this here.
    The figure below shows the m-to-n relationship between logical messages (business meaning) and IDoc types (technical format). Message 1, for example, is always assigned to one IDoc type, while message 3 is assigned to two IDoc types. IDoc type 2, in turn, is also assigned to 2 logical messages.
    10. The segment release specifies the release from which the segment definitions (not the IDoc type definition) originates. We recommend that you leave this field blank so that the most recent segment definition is used.
    11. You can propose an EDI standard, version and EDI message type for the receiving system in the tab page EDI Standard. Most subsystems, however, should be able to determine these EDI settings themselves (from the logical message).
    12. You can define permitted agents for cases in which exceptions occur. This entry overrides the entry in the general partner profiles. Depending on the message, therefore, the exception can be handled by different agents of the same partner.
    13. You can specify whether syntax errors are to be ignored or are to lead to a processing error (Cancel Processing flag under syntax check in the tab page outbound options). For more information about exception handling and permitted agents, refer to the following section: Exception Handling
    14. If your hardware supports it, create partner and message specific telephony data for outbound IDocs. For more information, see General Partner Profile.
    Graphic: Outbound partner profile fields (general)
    Key fields are shown in gray. The values for partner, message and test indicator (and client) therefore provide a unique ID for the IDoc type in outbound processing.
    Regards,
    Praveen

  • UPRE to replicate User Profiles and Managed Metadata to High Availability backup farm

    I'm working on a HA project, and have been tasked with replicating our User Profiles and Metadata to a newly created farm. I'll call the current production farm FarmA and the new HA farm FarmB. I've installed SharePoint2010AdministrationToolkit on FarmB,
    and used SPDiag to generate my first report on FarmB.
    We're not using MySites.
    I'm looking at
    http://technet.microsoft.com/en-us/library/jj891109(v=office.15).aspx and have some questions. Anything I do on FarmA will be done thought a Change Control, and I want to be able to answer questions intelligently.
    Does SharePoint2010AdministrationToolkit and UPRE have to be installed on FarmA and FarmB?
    Does enabling DTC create any security concern? Or performance hit? I haven't done this before.
    Any documented risks with using the replicator?
    Are scheduled replications typically 1 weekly full with nightly incrementals?
    Anything the replication won't copy over to FarmB? Like Synchronization Connections, or additional/custom fields?
    How are GUIDs handled?
    Sorry to pack 6 questions into one post ;)
    Thanks,
    Scott

    To answer the first question this is what MS says: The User Profile Replication Engine can be installed on any computer that has access to the source User Profile service application and destination User Profile service application. However, we recommend
    that you install the User Profile Replication Engine on a computer that is part of the source farm or on a computer that is connected to the subnet of the source domain. The User Profile Replication Engine uses the SharePoint Server 2010 User Profile and User
    Profile Change Log to read and write data between user profile stores. http://technet.microsoft.com/en-us/library/cc663011(v=office.15).aspx And to answer 4th question its true but full sync will only be required initially and only when there is org changes
    most of the time its incremental. To my knowledge FULL replication will bring all the details but not sure though.

  • Calculating the memory and performance of a oracle query

    Hi,
    I am now developing application in java with oracle as a back-end. In my application i require lot of queries to be executed. Hence, the system is getting is slow due to queries.
    So, i planned to develop one Stand-alone application in java, that should show the statistics like, memory and performance. for ex:- if i enter one SQL query in the text box, my standalone application should display, the processing time it requires to fetch the values and the memory is used for that query.
    Can anybody give ideas, suggestion, etc etc...
    Thanks in Advance
    Regards,
    Rajkumar

    This is now Oracle question, not JDBC question. :)
    Followings are sample for explain plan/autotrace/SQL*Trace.
    (You really need to read stuffs like Oracle SQL Tuning books...)
    SQL> create table a as select object_id, object_name from all_objects
    2 where rownum <= 100;
    Table created.
    SQL> create index a_idx on a(object_id);
    Index created.
    SQL> exec dbms_stats.gather_table_stats(user,'A');
    SQL>  explain plan for select from a where object_id = 1;*
    Explained.
    SQL> select from table(dbms_xplan.display());*
    PLAN_TABLE_OUTPUT
    Plan hash value: 3632291705
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    PLAN_TABLE_OUTPUT
    | 0 | SELECT STATEMENT | | 1 | 11 | 2 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| A | 1 | 11 | 2 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | A_IDX | 1 | | 1 (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Predicate Information (identified by operation id):
    2 - access("OBJECT_ID"=1)
    SQL> set autot on
    SQL> select * from a where object_id = 1;
    no rows selected
    Execution Plan
    Plan hash value: 3632291705
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 1 | 11 | 2 (0)| 00:00:01 |
    | 1 | TABLE ACCESS BY INDEX ROWID| A | 1 | 11 | 2 (0)| 00:00:01 |
    |* 2 | INDEX RANGE SCAN | A_IDX | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    2 - access("OBJECT_ID"=1)
    Statistics
    1 recursive calls
    0 db block gets
    1 consistent gets
    0 physical reads
    0 redo size
    395 bytes sent via SQL*Net to client
    481 bytes received via SQL*Net from client
    1 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    0 rows processed
    SQL> exec dbms_monitor.session_trace_enable(null,null,true,true);
    -- SQL> alter session set events '10046 trace name context forever, level 12';
    -- SQL> alter session set sql_trace = true;
    PL/SQL procedure successfully completed.
    SQL> select * from a where object_id = 1;
    no rows selected
    * SQL> exec dbms_monitor.session_trace_disable(null, null);*
    -- SQL> alter session set events '10046 trace name context off';
    -- SQL> alter session set sql_trace = false;
    PL/SQL procedure successfully completed.
    SQL> show parameter user_dump_dest
    */home/oracle/admin/WASDB/udump*
    SQL>host
    JOSS:oracle:/home/oracle:!> cd /home/oracle/admin/WASDB/udump
    JOSS:oracle:/home/oracle/admin/WASDB/udump:!> ls -lrt
    -rw-r----- 1 oracle dba 2481 Oct 11 16:38 wasdb_ora_21745.trc
    JOSS:oracle:/home/oracle/admin/WASDB/udump:!> tkprof wasdb_ora_21745.trc trc.out
    TKPROF: Release 10.2.0.3.0 - Production on Thu Oct 11 16:40:44 2007
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    JOSS:oracle:/home/oracle/admin/WASDB/udump:!> vi trc.out
    select *
    from
    a where object_id = 1
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 0.00 0.00 0 1 0 0
    total 3 0.00 0.00 0 1 0 0
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 55
    Rows Row Source Operation
    0 TABLE ACCESS BY INDEX ROWID A (cr=1 pr=0 pw=0 time=45 us)
    0 INDEX RANGE SCAN A_IDX (cr=1 pr=0 pw=0 time=39 us)(object id 65441)
    Elapsed times include waiting on following events:
    Event waited on Times Max. Wait Total Waited
    ---------------------------------------- Waited ---------- ------------
    SQL*Net message to client 1 0.00 0.00
    SQL*Net message from client 1 25.01 25.01
    Hope this helps

  • Performance Optimization Self Service- SAP help requirement

    Hi,
    I want to know whether for SAP's help is required for performing the self service of Performance Optimization.
    If we collect ST12 trace and use it to perform the self service then is the report which is generated from the self service sufficient to take further action or will I need some SAP expertise to implement / take corrective actions?
    In short, whether I can do the Performance Optimization by myself or I need help from SAP?
    Regards,
    Vishal

    hi,
    1) Is this service available to all the customer? (by all the customers I mean "Max Attention", "Enterprise Support" etc)
    i answer this above is it, from mz above reply, have you checked
    enterprise support customers can get five EGI sessions as free per year. please check
    http://service.sap.com/esacademy
    - click browse egis
    for your second question also I answered above
    Does the report itself gives suggestions or we need to provide the report to SAP
    here my reply above
    because Guided procedure itself the proven methodlogy from SAP, the report provides the lots of suggestions against the SAP best practices.
    you can use it yourself most of the time. if still you need expert guidance from SAP, book for EGI sessions. they called as expert guided implementations, remote support. duration might vary based on the session.
    again, service report is the source, you have to review yourself, if you are in EGI, sap use that report for guiding. Please review
    Thanks
    Jansi

  • Performance optimization

    Hi All,
    i am trying to learn sap basis. i want to know that what is performance optimization in sap basis and how it will be done. kindly help me. thanks in advance
    Regards,
    Subhash

    Hi Subhash,
    an answer to that question would easily fill a book, so I'd like to suggest one:
    SAP Performance Optimization Guide
    Thomas Schneider
    SAP Press
    ISBN 1-59229-069-8
    It's <b>the</b> performance bible and covers every aspect of performance optimization.
    Kind regards
    Dirk

  • Simple example of a profile and publication setup

    Post Author: cbaumann
    CA Forum: WebIntelligence Reporting
    Hi
    I am using Windows 2000 Server with Business Objects XI Release 2, SP3, english.
    I am trying to create a profile and publication to test some scenarios what's the best way to use it. I did not really found a good docu or description, how to set it up. Has anybody a good explanation, maybe using this beach universe ?
    I can then try to map this to my universe and see, how to use it.
    thanks, Chris

    JonWat wrote:
    If, for example, you wanted to write in some data and add the time it was added, then sending to Oracle something like:
    INSERT INTO MyTab(datacolumns,DateAdded)
    VALUES (datavalues, SYSDATE)
    where the data values are bound variables from your app, might be the best way to go about it.
    Rather than
    (Execute) MyInsertProc(datavalues)
    where the InsertProc actually does the insertI'd disagree actually; if you've got code occuring on the database then it's much easier to optimize it if the code is all in one place - ie. in a package/procedure/function somewhere in PL/SQL.
    I'm with Tom Kyte in that I prefer everything to go through transactional API's - that is, if you're intending to add a new user, have a procedure that calls the inserts into the various tables, updates, etc, rather than having the front end call each insert itself.
    If the system is trying to do bulk uploads, well there are better methods of doing that (SQL*Loader or external tables) than row by row single inserts.
    This thread is an interesting read, but specifically, Tom's answer here is relevant.

Maybe you are looking for