Improving the performance of OLAP in Oracle Database 11

Hi all

First of all sorry for a very generic question, lately I been faced with some problems of performance during the generation cubes

for example we had a problem of low SGA_memory, now we have referred questions to Doc-ID 1464064.1

to cut short-we have a list of things to look for in advance for OLAP can improve performance?

similar to the one mentioned in a blog post (improving the performance of OLAP in Oracle Database 10 g Release 1) which is for 10 g

we ORDM DW, which has the dimension of TIME based with about 10 k records sometimes, that it takes about 20 minutes to build recently its not not building at all throwing error mentioned Doc-ID 1464064.1 I have a wip SR to even SR 3-9620792761

Similarly, we produced Sun with approximately 9million records sometimes he finished in 4 hours sometimes it ends quite

I have twice fallen & recreated workspace that helps a little but does not appear inconsistent.

Pointers would be really useful

Thank you

Prateek

You can update following anonymous pl/sql block and change in your

specific information for the name of the cube and measure names. You

can add more steps as you like following the same convention of xml.

DECLARE

CLOB xmlCLOB;

tmp varchar2 (4000);

BEGIN

DBMS_LOB.CREATETEMPORARY (xmlCLOB, true);

DBMS_LOB. Open (xmlCLOB, DBMS_LOB. LOB_READWRITE);

tmp: ='

';

DBMS_LOB. WriteAppend (xmlCLOB, length (tmp), tmp);

dbms_cube.import_xml (xmlClob);

DBMS_LOB. Close (xmlClob);

END;

Tags: Business Intelligence

Similar Questions

  • How to improve the performance of the import

    I'm converting a database of its current WE8ISO88591 character set AL32UTF8
    I use NLS_LENGTH_SEMANTICS to TANK so I don't have to increase the length of the column.

    I followed the instructions in the Oracle:
    144808.1
    313175.1

    Except import that takes too long.

    I took a full database export WE8ISO8859p1 and now its importation in AL32UTF8.

    It is always difficult to prove slow source; but I think it has to do something with NLS_LENGTH_SEMANTICS. On the same
    Server; If the new database was in WE8ISO8859P1, a 5 million row table import took 2 hours; but in Al32UTF8 with NLS_LENGTH_SEMANTICS it takes 1 day!

    No idea how to improve the performance of the import.

    DOUBLE WIRE!

    Please, don't post duplicate discussions.

    Mark this thread ANSWER and continue to use your original thread where you are already helped.

    You have NOT given the info that has been ask in your other thread.
    Re: NLS_LENGTH_SEMANTICS = CHAR import is too slow

  • Help improve the performance of a procedure.

    Hello everyone,

    First of all to introduce myself. My name is Ivan and I recently started to learn the SQL and PL/SQL. Then don't go hard on me. :)

    Now let's move on to the problem. What we have here is a table (a large, but we will need only a few fields) with some information about the calls. 'S called it table1. There is also another, absolutely the same structure, which is empty and we must transfer the recordings of the first.
    The calls short (less than 30 minutes) have segmentID = "C1".
    Longer calls (over 30 minutes) are saved as multiple records (1 for every 30 minutes). The first record (the first 30 minutes of the call) a segmentID = "C21". It's the first time we have only one of them for each different call. Then we have the next parts (the middle one) of the appeal, having segmentID = "C22". We have more than 1 middle part and once again the maximum minutes in every 30 minutes. Then we have the last part (new max 30 minutes) with segmentID = "C23. As with the first, we can have that last part.
    So far so good. Now we need to insert these call records in the second table. The C1 are easy - a record = one call. But those partial we must combine so that they become a single whole call. This means that we must be one of the first pieces (C21), find if there is a middle part (C22) with the same caller/called numbers and with the difference in 30 minutes time, then additional research if there is an another C22 and so on. And finally, we search for the last part of the call (C23). As part of this research we sum the length of each part, so we can have the duration of the call at the end. Then, we are ready to be inserted into the new table as a single record, just with the new duration.
    But here's the problem with my code... The table a LOT of files and this solution, despite the fact that it works (at least in tests I've done so far), it is REALLY slow.
    As I said I am new to PL/SQL and I know that this solution is really newbish, but I can't find another way to do this.

    So I decided to come here and ask for some advice on how to improve the performance of this.

    I think you're getting confused already, so I'll just put some comments in the code.

    I know this isn't a procedure as at present, but it will be once I have create better code. I don't think it's important for now.
    DECLARE
    
    CURSOR cur_c21 IS
        select * from table1
        where segmentID = 'C21'
        order by start_date_of_call;     // in start_date_of_call is located the beginning of a specific part of the call. It's date format.
        
    CURSOR cur_c22 IS
        select * from table1
        where segmentID = 'C22'
        order by start_date_of_call;
        
    CURSOR cur_c22_2 IS
        select * from table1
        where segmentID = 'C22'
        order by start_date_of_call;   
        
    cursor cur_c23 is
        select * from table1
        where segmentID = 'C23'
        order by start_date_of_call;
    
    v_temp_rec_c22 cur_c22%ROWTYPE;
    v_dur table1.duration%TYPE;           // using this for storage of the duration of the call. It's number.
    
    BEGIN
    
    insert into table2
    select * from table1 where segmentID = 'C1';     // inserting the calls which are less than 30 minutes long
    
    -- and here starts the mess
    
    FOR rec_c21 IN cur_c21 LOOP        // taking the first part of the call
       v_dur := rec_c21.duration;      // recording it's duration
    
       FOR rec_c22 IN cur_c22 LOOP     // starting to check if there is a middle part for the call 
          IF rec_c22.callingnumber = rec_c21.callingnumber AND rec_c22.callednumber = rec_c21.callednumber AND  
            (rec_c22.start_date_of_call - rec_c21.start_date_of_call) = (1/48)                 
    /* if the numbers are the same and the date difference is 30 minutes then we have a middle part and we start searching for the next middle. */
          THEN
             v_dur := v_dur + rec_c22.duration;     // updating the new duration
             v_temp_rec_c22:=rec_c22;               // recording the current record in another variable because I use it for the next check
    
             FOR rec_c22_2 in cur_c22_2 LOOP
                IF rec_c22_2.callingnumber = v_temp_rec_c22.callingnumber AND rec_c22_2.callednumber = v_temp_rec_c22.callednumber AND  
                  (rec_c22_2.start_date_of_call - v_temp_rec_c22.start_date_of_call) = (1/48)         
    /* logic is the same as before but comparing with the last value in v_temp... 
    And because the data in the cursors is ordered by date in ascending order it's easy to search for another middle parts. */
                THEN
                   v_dur:=v_dur + rec_c22_2.duration;
                   v_temp_rec_c22:=rec_c22_2;
                END IF;
             END LOOP;                      
          END IF;
          EXIT WHEN rec_c22.callingnumber = rec_c21.callingnumber AND rec_c22.callednumber = rec_c21.callednumber AND  
                   (rec_c22.start_date_of_call - rec_c21.start_date_of_call) = (1/48);        
    /* exiting the loop if we have at least one middle part.
    (I couldn't find if there is a way to write this more clean, like exit when (the above if is true) */
       END LOOP;
                  
       FOR rec_c23 IN cur_c23 LOOP              
          IF (rec_c23.callingnumber = rec_c21.callingnumber AND rec_c23.callednumber = rec_c21.callednumber AND 
             (rec_c23.start_date_of_call - rec_c21.start_date_of_call) = (1/48)) OR v_dur != rec_c21.duration           
    /* we should always have one last part, so we need this check.
    If we don't have the "v_dur != rec_c21.duration" part it will execute the code inside only if we don't have middle parts
    (yes we can have these situations in calls longer than 30 and less than 60 minutes). */
          THEN
             v_dur:=v_dur + rec_c23.duration;
             rec_c21.duration:=v_dur;               // updating the duration
             rec_c21.segmentID :='C1';
             INSERT INTO table2 VALUES rec_c21;     // inserting the whole call in table2
          END IF;
          EXIT WHEN (rec_c23.callingnumber = rec_c21.callingnumber AND rec_c23.callednumber = rec_c21.callednumber AND 
                    (rec_c23.start_date_of_call - rec_c21.start_date_of_call) = (1/48)) OR v_dur != rec_c21.duration;                  
                    // exit the loop when the last part has been found. 
       END LOOP;
    END LOOP;
    
    END;
    I'm using version 1.5.5 Developer SQL and Oracle 11 g.

    This is my first post here so I hope it's the right subforum.
    I tried to explain it as deep as possible (sorry if it's too long) and I kinda think that code got a bit hard to read with all these comments. If you want I can delete them.
    I know that I'm missing a lot of knowledge for all the help is really appreciated.

    I thank very you much in advance!

    Hi and welcome to the forums.

    Thanks for posting your code (and using code tags... it's a miracle of a novice!).

    What would be nice would be if you could provide some example data and expected results; as described in the FAQ: {message identifier: = 9360002}

    Your code is very likely to be slow because of the number of nested loops cursor that you use. Which is known in the trade as treatment of rank by rank (more affectionately known as slow-by-slow transformation, as he was known to be slow). It is slow because the PL engine must keep going back and forth between himself and the SQL engine and the INSERT you in a loop called SQL much time to insert data.

    Usually this kind of thing can be achieved by using something like a single INSERT... ... SELECT statement where the SELECT all the treatment that you put in the language PL, or sometimes a SQL MERGE statement if a conditional is sort of insert/update.

    If you post your data so people can get an idea of what is the logic (and have something to test with and know what results should be) then we can help.

  • How to improve the performance of the Intel X 3100 on Satellite L300

    Hello everyone.

    First of all, I don't know if this is an appropriate place to post this thread here or no, but I would like to share with you the experience relating to the improvement of Intel X 3100 (GMA965).

    As we know, there is no driver is good for this chipset from Intel for the moment, especially on VIsta.
    This improvement is made by editing the registry of Intel driver.

    * Steps: *.
    * 1 * open run (Windows + R)
    * 2 * enter Regedit
    * 3 * open the subfolder: * HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contr ol\Video\ *.
    * 4 * from there you'll see lots of subfolders in video, open each one until you see the folder * 0000 * with + _3DMark03.exe +.
    (For example, my is {HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contr ol\Video\ {B5990899-FBCB-45E1-B0B0 *} and reg DWord _3Dmark03.exe lies in two subfolders * 0000 * and * 0001 *})
    * 5 * in * 0000 * and * 0001 *, create two new * DWORD format: * _software.exe* and * ~ software.exe*, value = 1 (hexadecimal). Here, * software * represents the name of the program you want to accelerate as * _photoshop.exe* and * ~photoshop.exe*
    * 6 * in these files, search for * GFX_Options * and change its value to * 1 *.
    * 7 * restart your computer to activate GFX
    * 8 * repeat step 4 to add more programs you want

    Other updates for the drivers are under developed. However, this method will help you to speed up your computer performance with + heavy + graphical software required. I got double FPS on some software on my Toshiba L300 using this method such as Corel, WarcraftIII and Titan Quest (24-32 fps measurement by Fraps)

    Hope it's useful for everyone.
    Best wishes

    Hi Luong Phan

    Thanks a lot for the details and this great instruction.

    I also found this thread. It s your ;)

    + Improve the performance of Satellite L300 graphics software and games-Vista +.
    http://forums.computers.Toshiba-Europe.com/forums//message.jspa?MessageID=119890#119890

    It s the same statement. I am happy. Thank you

  • How to improve the performance of your computer and free up space.

    Original title: the unwanted temporary files of windows is at the origin of the problems of proformanace

    According to a check of problem: the unwanted files temporary windows could take to improve the performance of your computer and free up space.

    Can anyone help with this simple problem.

    Angelo

    Hi Angelo,.

    1. which edition of Windows are you running?
    Example: Windows 7 Professional 32 bit.
    Please follow the below link to clean unwanted temporary files.
    Delete files using disk cleanup
     
    Microsoft at home.
    Slow PC? Optimize your computer for peak performance
    Make slate: how to remove the unwanted files and programs
     
    I hope this helps.
  • I have the computer laptop dv7 - 7227cl of HP Envy, is there a way to improve the performance of game?

    I have windows 8.1, 8 GB ram, amd quad core 4600 a10 m. Is it possible to increase its performance?

    Hello

    You seem to have pretty good specifications in the laptop.

    Even so, I prefer Intel than AMD processors.
    Try playing in low & medium resolution.

    You can go through this document, it can help you in improving the performance: http://support.hp.com/us-en/document/c03340676

    Thank you

  • How can I improve the performance of my compaq presario V2000, its very slow

    How can I improve the performance of my compaq presario V2000, its very slow!

    According to many things (specifications, you have now installed vs the programs he came originally with programs, etc.)-it may or may not work better that ever he does now.  However, in terms of nothing other than the software and others on the subject - there are some things you can do to optimize performance.

    Search for malware:

    Download, install, execute, update and perform analyses complete system with the two following applications:

    Remove anything they find.  Reboot when necessary.  (You can uninstall one or both when finished.)

    Search online with eSet Online Scanner.

    The less you have to run all the time, most things you want to run will perform:

    Use Autoruns to understand this all starts when your computer's / when you log in.  Look for whatever it is you do not know using Google (or ask here.)  You can hopefully figure out if there are things from when your computer does (or connect) you don't not need and then configure them (through their own built-in mechanisms is the preferred method) so they do not - start using your resources without reason.

    You can download and use Process Explorer to see exactly what is taking your time processor/CPU and memory.  This can help you to identify applications that you might want to consider alternatives for and get rid of all together.

    Do some cleaning and dusting off this hard drive:

    You can free up disk space (will also help get rid of the things that you do not use) through the following steps:

    Windows XP should take between 4.5 and 9 GB * with * an Office suite, editing Photo software, alternative Internet browser (s), various Internet plugins and a host of other things installed.

    If you are comfortable with the stability of your system, you can delete the uninstall of patches which has installed Windows XP...
    http://www3.TELUS.NET/dandemar/spack.htm
    (Especially of interest here - #4)
    (Variant: http://www.dougknox.com/xp/utils/xp_hotfix_backup.htm )

    You can run disk - integrated into Windows XP - cleanup to erase everything except your last restore point and yet more 'free '... files cleaning

    How to use disk cleanup
    http://support.Microsoft.com/kb/310312

    You can disable hibernation if it is enabled and you do not...

    When you Hibernate your computer, Windows saves the contents of the system memory in the hiberfil.sys file. As a result, the size of the hiberfil.sys file will always be equal to the amount of physical memory in your system. If you don't use the Hibernate feature and want to reclaim the space used by Windows for the hiberfil.sys file, perform the following steps:

    -Start the Control Panel Power Options applet (go to start, settings, Control Panel, and then click Power Options).
    -Select the Hibernate tab, uncheck "Activate the hibernation", and then click OK. Although you might think otherwise, selecting never under "Hibernate" option on the power management tab does not delete the hiberfil.sys file.
    -Windows remove the "Hibernate" option on the power management tab and delete the hiberfil.sys file.

    You can control the amount of space your system restore can use...

    1. Click Start, right click my computer and then click Properties.
    2. click on the System Restore tab.
    3. highlight one of your readers (or C: If you only) and click on the button "settings".
    4 change the percentage of disk space you want to allow... I suggest moving the slider until you have about 1 GB (1024 MB or close to that...)
    5. click on OK. Then click OK again.

    You can control the amount of space used may or may not temporary Internet files...

    Empty the temporary Internet files and reduce the size, that it stores a size between 64 MB and 128 MB...

    -Open a copy of Microsoft Internet Explorer.
    -Select TOOLS - Internet Options.
    -On the general tab in the section 'Temporary Internet files', follow these steps:
    -Click on 'Delete the Cookies' (click OK)
    -Click on "Settings" and change the "amount of disk space to use: ' something between 64 MB and 128 MB. (There may be many more now.)
    -Click OK.
    -Click on 'Delete files', then select "Delete all offline content" (the box), and then click OK. (If you had a LOT, it can take 2 to 10 minutes or more).
    -Once it's done, click OK, close Internet Explorer, open Internet Explorer.

    You can use an application that scans your system for the log files and temporary files and use it to get rid of those who:

    CCleaner (free!)
    http://www.CCleaner.com/
    (just disk cleanup - do not play with the part of the registry for the moment)

    Other ways to free up space...

    SequoiaView
    http://www.win.Tue.nl/SequoiaView/

    JDiskReport
    http://www.jgoodies.com/freeware/JDiskReport/index.html

    Those who can help you discover visually where all space is used.  Then, you can determine what to do.

    After that - you want to check any physical errors and fix everything for efficient access"

    CHKDSK
    How to scan your disks for errors* will take time and a reboot.

    Defragment
    How to defragment your hard drives* will take time

    Cleaning the components of update on your WIndows XP computer

    While probably not 100% necessary-, it is probably a good idea at this time to ensure that you continue to get the updates you need.  This will help you ensure that your system update is ready to do it for you.

    Download and run the MSRT tool manually:
    http://www.Microsoft.com/security/malwareremove/default.mspx
    (Ignore the details and download the tool to download and save to your desktop, run it.)

    Reset.

    Download/install the latest program Windows installation (for your operating system):
    (Windows XP 32-bit: WindowsXP-KB942288-v3 - x 86 .exe )
    (Download and save it to your desktop, run it.)

    Reset.

    and...

    Download the latest version of Windows Update (x 86) agent here:
    http://go.Microsoft.com/fwlink/?LinkId=91237
    ... and save it to the root of your C:\ drive. After you register on the root of the C:\ drive, follow these steps:

    Close all Internet Explorer Windows and other applications.

    AutoScan--> RUN and type:
    %SystemDrive%\windowsupdateagent30-x86.exe /WUFORCE
    --> Click OK.

    (If asked, select 'Run'). --> Click on NEXT--> select 'I agree' and click NEXT--> where he completed the installation, click "Finish"...

    Reset.

    Now reset your Windows with this FixIt components update (you * NOT * use the aggressive version):
    How to reset the Windows Update components?

    Reset.

    Now that your system is generally free of malicious software (assuming you have an AntiVirus application), you've cleaned the "additional applications" that could be running and picking up your precious memory and the processor, you have authorized out of valuable and makes disk space as there are no problems with the drive itself and your Windows Update components are updates and should work fine - it is only only one other thing you pouvez wish to make:

    Get and install the hardware device last drivers for your system hardware/system manufacturers support and/or download web site.

    If you want, come back and let us know a bit more information on your system - particularly the brand / model of the system, you have - and maybe someone here can guide you to the place s x of law to this end.  This isn't 100% necessary - but I'd be willing to bet that you would gain some performance and features in making this part.

  • Anyone have information about the software to improve the performance of a computer called "MECHANICAL SYSTEM"

    original title: windows xp

    has anyone information about the software to improve the performance of a computer called "MECHANICAL SYSTEM"?

    It is located on the website at WWW.IOLO.COM.

    Maybe someone of expertise of knowledge about this software?   or maybe someone has experience with this product?

    There is a similar product, without the costs?

    DO NOT BUY OR INSTALL "SYSTEM MECHANIC".

    IT will bog your system with errors, which would mean probably a complete restoration of your system.

    Dell recommends and sells it from their technical support group and SHAME on THEM for DOING SO.

    THIS SOFTWARE IS A TRAGEDY IN THE MAKING.

    Go to PC Mag reviews and you will see for yourself that there is a very LOW RATING and under normal conditions, you need software to mess with your registry.

    I know someone who has installed this program and we always try to fix all of the errors generated by mechanical system.

    We did a complete restoration and stil having problem.

    Thus he PURCHASE a CERTAINLY DO NOT GOLD INSTALLER CE PROGRAM.

  • What is the best way to improve the performance of this all-in-one PC?

    What is the best way to improve the performance of this all-in-one PC?

    Thanks in advance.

    David Barrett.

    Here are a few methods:

    • Run msconfig.exe, and then uncheck the startup tasks that you don't need. No matter what you disable, Windows always starts.
    • Use a light virus scanner, for example Microsoft Security Essentials.
    • Replace your magnetic drive with a Solid State Disk (SSD)
  • delete prefetch files - other recommendations to improve the performance of the computer please

    After that I deleted the prefetch folder, use tools online to improve the performance of my computer in Windows 7?

    After that I deleted the prefetch folder, use tools online to improve the performance of my computer in Windows 7?

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-performance/does-deleting-the-contents-of-a-prefetch-folder/1b9d4ab7-B553-4990-881c-5702ad724d8d

  • Whenever I try to evaluate and improve the performance of the computer, I get a type of white blue screen telling me I have bad software or hardware and my computer does climb?

    Whenever I try to evaluate and improve the performance of the computer, I get a type of white blue screen telling me I have bad software or hardware and my computer does climb? He did NOT finish the task is content to any screen blue screen saying it's bad it's bad, your computer is messed up bigtime, so-to-speak

    Hi Cynthia,.

    1 have you ever done any hardware or software changes to the PC?

    2. What is the brand and model of the PC?

    3. What is the full error you get when you try to evaluate the computer?

    Audit of the statues of the device in the Device Manager.
    a. click the Start button, type devmgmt.msc and press ENTER.
    b. check for any exclaimation mark and the status of the devices.

    Follow these methods.

    I suggest you to first run the resolution of performance problems.

    Method 1: Open the resolution of Performance problems
    http://Windows.Microsoft.com/en-in/Windows7/open-the-performance-Troubleshooter

    Method 2: Disconnect non-essential external devices and try to evaluate the computer.

    Method 3:  Also, temporarily disable the antivirus and check the question.  Anti-virus programs are sometimes called causes this problem.

    Turn off the Antivirus software
    http://Windows.Microsoft.com/en-us/Windows-Vista/disable-antivirus-software
    Note: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.

    Let us know if it helps. If the problem persists, please answer, we will be happy to help you.

  • I need to improve the performance of a Web site and I want to track the total number of requests per second...

    I need to improve the performance of a Web site and I want to track the total number of requests per second... we are currently hitting...

    Please I need to hit the current with 1200 queries/second application, please help in this regard.

    Hi Nivask,

    If you created the Web site, the question would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums for assistance:

    Internet Explorer Web development

  • Deploy the adf on glassfish with oracle database server.

    I am trying to create a connection from the pool on glassfish 4 oracle database server.

    but I could not. I was trting to ping and show this error ping Connection Pool failed for audio. Class name is incorrect or classpath is not set to: oracle.jdbc.pool.OracleDataSource

    GlassFish 3.1 is supported, 4.x is not.

    Oracle JDeveloper and ADF 12 c (12.1.3) supported systems

  • Improve the performance of processing image javaFx

    Hello

    I'm working on Image processing with javaFx. I think my code isn't effective favorite (with pictures HD, refresh is very slow). Because I am doing a 'for' on each pixel of my image every time I have to refresh it. But I don't know how else to do.

    So I need help to improve the performance of my treatment.

    This is my code:

    import javafx.application.Application;
    import jvafx.beans.InvalidationListener;
    import javafx.beans.Observable;
    import javafx.beans.property.DoubleProperty;
    import javafx.scene.Scene;
    import javafx.scene.control.ScrollPane;
    import javafx.scene.control.Slider;
    import javafx.scene.image.Image;
    import javafx.scene.image.ImageView;
    import javafx.scene.image.PixelReader;
    import javafx.scene.image.PixelWriter;
    import javafx.scene.image.WritableImage;
    import javafx.scene.layout.AnchorPane;
    import javafx.scene.paint.Color;
    import javafx.stage.Stage;
        
    public class Example extends Application {
    
        private Image src;
        private WritableImage dest;
        private int width;
        private int height;
         int value = 0;
    
        @Override
        public void start(Stage stage) {
            AnchorPane root = new AnchorPane();
            initImage(root);
            Scene scene = new Scene(root);
            stage.setTitle("Demo processing");
            stage.setResizable(false);
            stage.setScene(scene);
            stage.show();
        }
    
        private void initImage(AnchorPane root) {
            src = new Image(
                    "http://mikecann.co.uk/wp-content/uploads/2009/12/ScreenHunter_02-Dec.-10-19.41-1024x484.jpg");
            width = (int) src.getWidth();
            height = (int) src.getHeight();
            root.setPrefSize(800, 800 + 50);
            ScrollPane scrollPane = new ScrollPane();
            scrollPane.setPrefHeight(600);
            scrollPane.setPrefWidth(1000);
            dest = new WritableImage(width, height);
            ImageView destView = new ImageView(dest);
    
            scrollPane.setContent(destView);
    
            root.getChildren().add(scrollPane);
            AnchorPane.setTopAnchor(scrollPane, 0.0);
    
            Slider slider = new Slider(0, 255, 1);
            slider.setPrefSize(800, 50);
            slider.setShowTickLabels(true);
            slider.setShowTickMarks(true);
            slider.setSnapToTicks(true);
            slider.setMajorTickUnit(1.0);
            slider.setMinorTickCount(0);
            slider.setLayoutY(700);
            slider.valueProperty().addListener(new InvalidationListener() {
                @Override
                public void invalidated(Observable o) {
                    value = (int) ((DoubleProperty) o).get();
                    color();
                }
            });
            root.getChildren().add(slider);
            color();
        }
    
        private void color() {
            PixelReader reader = src.getPixelReader();
            PixelWriter writer = dest.getPixelWriter();
            for (int x = 0; x < width; x++) {
                for (int y = 0; y < height; y++) {
                    Color color = reader.getColor(x, y);
                    double red = (double) value * x * y / (width * height) / 255;
                    double green = color.getGreen();
                    double blue = (double) value * ((width * height) - x * y)
                            / (width * height) / 255;
                        writer.setColor(x, y, Color.color(red, green, blue));
                    }
                }
            }
    
            public static void main(String[] args) {
                launch(args);
            }
        }
    

    And that's with full HD picture:

                src = new Image(
                    "http://www.freedomwallpaper.com//nature-wallpaper-hd/hd_sunshine_hd.jpg");
    

    As you change each pixel independently, there really is no other way than to use a loop through the pixels. Working directly with the pixel data, rather than use setColor and getColor (...) (...) seems to give some performance enhancements. And there are some general performance enhancements, you can use (reorder the loops, calculate the value used repeatedly, etc.). The performance of this version seems acceptable on my system:

    import javafx.application.Application;
    import javafx.beans.InvalidationListener;
    import javafx.beans.Observable;
    import javafx.beans.property.DoubleProperty;
    import javafx.scene.Scene;
    import javafx.scene.control.ScrollPane;
    import javafx.scene.control.Slider;
    import javafx.scene.image.Image;
    import javafx.scene.image.ImageView;
    import javafx.scene.image.PixelFormat;
    import javafx.scene.image.PixelWriter;
    import javafx.scene.image.WritableImage;
    import javafx.scene.layout.AnchorPane;
    import javafx.stage.Stage; 
    
    public class ImageProcessingExample extends Application { 
    
        @Override
        public void start(Stage stage) {
            AnchorPane root = new AnchorPane();
            initImage(root);
            Scene scene = new Scene(root);
            stage.setTitle("Demo processing");
            stage.setResizable(false);
            stage.setScene(scene);
            stage.show();
        }
        private void initImage(AnchorPane root) {
    //        Image src = new Image(
    //                "http://mikecann.co.uk/wp-content/uploads/2009/12/ScreenHunter_02-Dec.-10-19.41-1024x484.jpg");
            Image src = new Image(
                    "http://www.freedomwallpaper.com//nature-wallpaper-hd/hd_sunshine_hd.jpg");
            int width = (int) src.getWidth();
            int height = (int) src.getHeight(); 
    
            int[] srcPixels = new int[width*height];
    
            src.getPixelReader().getPixels(0, 0, width, height, PixelFormat.getIntArgbPreInstance(), srcPixels, 0, width);
    
            root.setPrefSize(800, 800 + 50);
            ScrollPane scrollPane = new ScrollPane();
            scrollPane.setPrefHeight(600);
            scrollPane.setPrefWidth(1000);
            WritableImage dest = new WritableImage(width, height);
            PixelWriter pixWriter = dest.getPixelWriter();
    
            ImageView destView = new ImageView(dest);
            scrollPane.setContent(destView);
            root.getChildren().add(scrollPane);
            AnchorPane.setTopAnchor(scrollPane, 0.0);
            Slider slider = new Slider(0, 255, 1);
            slider.setPrefSize(800, 50);
            slider.setShowTickLabels(true);
            slider.setShowTickMarks(true);
            slider.setSnapToTicks(true);
            slider.setMajorTickUnit(1.0);
            slider.setMinorTickCount(0);
            slider.setLayoutY(700);
            slider.valueProperty().addListener(new InvalidationListener() {
                @Override
                public void invalidated(Observable o) {
                    int value = (int) ((DoubleProperty) o).get();
                    color(srcPixels, pixWriter, value, width ,height);
                }
            });
            root.getChildren().add(slider);
            color(srcPixels, pixWriter, 0, width, height);
        }
        private void color(int[] srcPixels, PixelWriter pixWriter, int value, int width, int height) {
            final int area = width * height ;
            final int[] writerPixels = new int[area];
    
            final int a = 0xff00_0000;
            final int greenMask = 0xff00;
    
            for (int y = 0; y < height; y++) {
                final int depthOffset = y * width ;
                for (int x = 0; x < width; x++) {
                    final int xy = x * y;
    final int index = x + depthOffset ;
                    final int red = value * xy  / area ;
                    final int green = srcPixels[index] & greenMask ;
                    final int blue = value * (area - xy)  / area ;
                    writerPixels[index] = a | red << 16 | green | blue ;
                }
            }
            pixWriter.setPixels(0, 0, width, height, PixelFormat.getIntArgbInstance(), writerPixels, 0, width);
        }
            public static void main(String[] args) {
                launch(args);
            }
        } 
    
  • Improve the performance of a conversion program

    Hello

    If I have millions of records to import through a conversion program (for ex: inventory of the item data), is it possible to improve the performance? Any help is appreciated.

    Thank you

    Swathi Jonathan

    Published by: user10481236 on August 22, 2010 06:18

    You can significantly improve point importation using the set_process_id to divide the records and by launching several requests for point import at the same time.

    Sandeep Gandhi

Maybe you are looking for

  • NB100 - OS uses only 500 MB of RAM - 1 GB memory total

    I spent the NB100 to 1 GB memory, but I have seen that the OS never exceeds 500 MB despite the use of many resources.The CPU very quickly gets to 100% and work becomes very slow.On my other computers open the same amount of firefox windows are for ex

  • Satellite A660 - fan and temperature problem

    Probably after that Bios Update to 2.3 increased fan is efficient and temperatures grew deadlySo please help! I can't work on my laptop and the children cannot play in games (even simpler)regards and sorry for my English

  • Satellite Pro L350 - when you use internet through Wi - Fi screen hangs

    Recentlyt purchased by Satellite Pro L350. When to use internet through Wi - Fi screen hangs. I can not turn off.Had to remove the battery to stop. Recharged the battery and released in market, OK for a while then same occurrence. Help!

  • HP Photosmart C6180, scanning Multipage problem (PC running Windows 8.1)

    When I try to scan more than one page, the application of scanner stops working. The preview window shows between 1/3 and 1/2 of the scanned page and I have to restart my computer to be able to continue the scan. Essentially, I'm reduced to the analy

  • Replacement card mother T410

    Hi guys,. I've been Googling a few weeks now with no luck. I use a lenovo T410 Eh well try to use it, but keep freeze stops.I have windows7 64 bit installed, tried the dualboot win7 and linux, I tried linux only.I have checked/tested the hard drive m