loading times excessive strengthening JList large

I have a request [url http://r0k.us/graphics/SIHwheel.html] using a JList. The size is variable and can be recharged with a different list of things. So far, the size of the list max has been about 1600 and (re) boots were quick, a matter of a few seconds for the 1600-element of the list.

Now, I would like to work with the largest lists, one with more 4,000 items and one with more 60 000. The 4 000 element we load in 20 seconds approximately (more than double the list 1 600 - element). The 60 000 elements takes several hours - so much I did not right it ends. The problem is, the more items there, more it takes to add a new item.

Here is a simplified version of the reset from the list. Note that the 'model' is the data represented by the list.
class simpler
{
    final DefaultListModel model = new DefaultListModel();
    private JList               list;
// following line in GUI initialization
//        list = new JList(model);

    private void getSortedNames(int sortCmd)
    {
        int howbig = 50000;
        ColorName worker;
        String hexName[];

        // clear-out old elements
        list.clearSelection();
        model.removeAllElements();  // without this line, even small lists take long time
        model.ensureCapacity(howbig);  // just added hoping it would help.  It doesn't.

        for (int i = 0; i < howbig; i++)
        {
if ((i % 16) == 1) System.out.print(i + " ");
            hexName = new String[2];
//            worker = ColorName.findColorName(i);
//            hexName[0] = worker.getHex();
//            hexName[1] = worker.getName();
hexName[0] = Integer.toString(i);
hexName[1] = Integer.toString(i + 1);
            model.addElement(hexName);
        }
    }
}
In the loop lines that start on the first column is debugging stuff. I wasn't sure if the slowdown was due to findColorName() or addElement(), so I got out of the game findColorName(). No effect on the speed, so I'm sure it's in Voodoo addElement() where lies the problem of gradual slowdown.

If I do not create a new hexName] each iteration, the process is extremely fast. Of course, creating 50,000 items of list of the same instance of the same data.

After studying [url http://docs.oracle.com/javase/1.4.2/docs/api/javax/swing/DefaultListModel.html] class DefaultListModel, I tried to replace model.addElements (hexName) with two model.set (i, hexName) and model.setElementAt (hexName, i). Both have led to errors of execution, with the crash of Jlist. (In some cases the rest of the program would continue.) I don't know what is the difference between the set() and setElementAt(), but none worked. I was hoping with all JList prealloue advance, it would be quicker set by index rather than add at the end. Maybe it would be if the operation could end without crashing.

Does anyone have an idea how to speed this up?

I tried to respond point by point to your previous answer but came to the conclusion that I really don't understand what you're trying to do. I'm reeling when talking about resolution 60 000 colors so I can't continue with this argument. I know that by using a list of length approximately 60,000 goes against all my experience of GUI, and everything I've read about the usefulness of GUI. I try to limit areas not drop more than 15 Articles and lists to no more than 60 Articles and would never ever consider never again 1,000 items so much 60 000!

For JComboBox and JTables and JLists should rarely add an element at a time especially if the length is important. For each item added to that an event is sent to all the listeners. If you add 60 000 items, you get 60 000 events but is only really needed! Think in terms of wrapper classes that implement the desired models. Think about having several converters that render an entry given in the model in various ways. Think of sort without actually create copies or sort the real objects; indirect kind is very very powerful. Think about other models packing and respond to events sent by these packaged models.

For a customer, I read at the start of a database in an event focused on the list of tuples. I have several TableModels used to display different views of the data that everyone reacts to events generated by the original list. When the original list is updated by the user all other models receive events that show the change and update any necessary prior to notifying the graphical interface it needs to update the display. Each JTable has a set of specific converters. Other rendering engine, I never copy the data or create versions of string data to display.

Tags: Java

Similar Questions

  • The loading time of a Web page takes about 30 seconds. How can I improve this

    It comes to this page: http://www.barronstudio.nl/hoogstraat-2-bergen-op-zoom.html

    Hello CreativeBarron,

    I checked your site at my end and observed that you used several large images in Muse that contributes to the load time. Please look at the screenshot below.

    By reducing the size of these images, you can certainly reduce the loading time of the site.

    Kind regards

    Vivek

  • I can't open all the Web sites in firefox(version 25), its long loading time, help please

    I can't open all the Web sites in firefox(version 25), its long loading time, help please

    Hello, normally these problems are caused by a security/firewall software which does not recognize and therefore blocks the new versions of firefox: solve connection problems to websites after Firefox update

  • Is any application of Benchmarking available in FFOS? Basically, I want to compare the performance as 'time to load application', "Image load time", etc.

    I'm basically performing team. Working in porting gecko 1.2. We did successfully porting. But we believe that it is not as big as gecko 1.1 performance. If we want any tool/app to measure performance.
    (1) application of loading time
    (2) time of image rendering
    (3) audio integrated
    (4) key response time
    (5) browser, loading time
    etc.

    Hello

    Thank you for your interest in Firefox OS. In the application settings click the device information > more information > developer. You will find tools for dev for load time, frames per second, etc.

    Best regards
    Michelle Luna

  • Slow load time

    Any ideas why the Sansa Fuze + takes a long time to load? 5 hours for a full Charge?

    Slow load time means that the usb port is off a small amount of power. If you are using a desktop pc, use a usb port back as the front are usually of low power. If you use a laptop, then plug the laptop power supply before you start to charge the player. For faster loading, use a usb adapter which is rated at 1 amp output (1 000 my). Most usb adapters only put my well of about 500.

  • HP pavilion slimline s5-1114 (win7) Long loading time

    Hi, my s5-1114 recently got extremely load times long(2-5min) when I start a program (games, internet explorer, etc. etc) for the first time, after I turned on the computer. I tried to load the pc in safe mode and the LAG disappeared but I can't seem to find the problem.

    Thanks in advance.

    Hello

    Please try this link might help you solve your problem.

    How to do a clean boot

  • Slow loading time

    My site load times have slowed considerably since Muse last updated. Checked in Safari, Firefox and Chrome - ideas? Site is h2oonstone.com - thanks

    You have a backup of your files? You can return to your previous version and see if you can reproduce this problem?

    How to find and install a previous Version of Adobe Apps in CC 2015 | Adobe Customer Care Team

  • Improve load times

    I use LR 6.5 on a PC with these stats:

    -OS = Windows 10 Home 64-bit

    -Processor = Intel Core i7 4500U 1.80 GHz

    -RAM = 8.00 GB Single - Channel DDR3 @ 798 MHz

    -Storage = 1862 GB Western Digital WD my Passport USB Device (SUB (SATA) 0827

    I use a laptop now instead of my old office and the loading time is very slow.  Is the speed of loading photo (in the Panel of a development library) led by the hardware I use or is there something I can do in LR that accelerate?  I really hope that I can speed up since I was 4 000 pictures to review on my last trip.

    Thanks for your help.

    RR

    If you have enabled the graphics acceleration, turn the power off (preferences-> Performance tab-> clear the check box)

    Opening a file to develop speed is mainly driven by the CPU. By today's standards, your processor is pretty slow. You would probably get a faster processor

  • Suggestions for optimazion (improve loading times, format adjustments for different resolutions) for my homepage?

    Dear Helper,

    I have problems with:

    -a loading time very long on my homepage

    -with the clear understanding on small resolutions (small laptops).

    You have ideas for this problem?

    Thank you

    Ron

    www.Oybiner-huette.de

    Hello

    In addition, take a look at this article

    Optimize images in Adobe Muse | Adobe Muse CC tutorials

  • How to speed up site load times?

    Can someone tell me how to speed up site load times?

    I know that the affects of size of image loading time... more tips?

    If you could take a look at my site and tell me how bad it is that would be great!

    www.ligacreative.com

    (1) do not use GIF images. The only time where .gif must always be used would be for small moving images (which, IMO, is a questionable practice 'design'). Muse won't touch a GIF image. It will be passed through. Image http://www.ligacreative.com/images/ieva-lc.gif your site into an image of 35 million pixels (HUGE). It is the only represent 4 seconds to download on the connection time average US broadband. Convert to PNG or JPEG, and replace the image within the Muse and Muse will be resize and recompress the image to the output of a small fraction of its current size of file.

    (2) use JPG of an image that is photographic in nature.

    (3) use the PNG for images that are generated by computer (i.e. images with hard edges or areas of color United, where the JPEG compression is likely to put objects in the image). If you have this type of images, deselect "Convert PNG" opaque in JPEG in the properties of the Site.

    (4) use the PNG for images that contain areas totally or partially transparent (as JPEG doesn't support transparency).

    (5) avoid having transparency in photographic images when possible. If you can cook the background color in the image, do. An opaque image can be JPEG. If there is no transparency in the image, it should be PNG (or GIF). For a photographic image PNG is about 5 times more grand and so 5 times longer to download than a comparable JPEG.

    (6) to resize the images as images of background fill for browser filling, fill the page or fill to an object of width 100% browser before importing. Muse does not automatically resize these images, then you must decide what your site maximum screen width Web will be targeting and resize these images outside Muse prior to importation.

  • Loading time of extension has suddenly skyrocketed

    So before Illustrator update this week, my HTML5 extensions loaded until recently almost instantly. Now, when I opened them, they freeze Illustrator for 60 to 90 seconds, then load. I couldn't see anything in the notes to the extensions. What has changed?

    I think I have it narrowed down to my task manager, GulpJS. I removed SWIG modules at the signature of the extension and the loading times are back to normal. Strange, but this is the solution I found.

  • Advice needed on speeding up load times.

    I need some tips on how I can speed up the load time on a page of my site. This page: http://www.thinksmartresumes.com.au/%2499-designs.html

    I know there are hundreds of localized factors, including the Internet, but many people have now pointed out that this page take more than 30 seconds to load. I know it's a great page with a lot of png and the links. What can I do to speed things up?

    Any advice welcome outside to split the page (which are not an option). I can't read the code btw.

    Congratulations to all.

    Now we need 6.2 MB to download the content and 5.8 for the images.

    If the performance is improved with the resizing of the images.

    Thank you

    Sanjit

  • How can I speed up the load time of my site?

    Hello

    How can I speed up the load time of my site hosted on BusinessCatalyst.

    http://www.PW-energy.co.UK

    Is there a way to compress?

    Any help much apprecated.

    Thank you

    Hello

    The page/site seems to load very well at the moment.

    However if want to inspect what could slow down the loading of your page I recommend using 'firebug' and select the 'network' tab to follow every chronology file loading.  Then you can see which file takes more time to load to help make adjustments accordingly.

    http://getfirebug.com/

    Kind regards

    -Sidney

  • Animated border and wordpress: loading time

    Hi lovely people of edge!

    I have a site for which I develop some interactive maps using edge. I have no idea how the code so most of my functions is limited to the deactivation of the elements to get things to do what I want. Very basic, I know, please don't laugh too much!

    It's a (custom) Wordpress site and I use the plugin suite of edge to get the edge on the site animations.

    My question is about the load time and the size of file for edge entertainment. My .oam files are approximately 1.5 to 2 MB. Is this great? Should I aim for smaller?

    This is a link to a page on the site:

    e-sheep-at-a-beautiful-coastal-Farm-Park/ http://everywhereyougo.co.nz/2013/04/Duder-Regional-Park-Walking-and-picnicking-amongst-th

    The animation of edge load she particularly slow for you? Doesn't load it at all? I would be interested in your comments!

    Thank you much in advance,

    Lisa in New Zealand.

    Hey, Lisa.

    The animation loaded for me very well, but look in the Net Panel in Firebug shows that a number of your SVG is more of 300K.  This seems quite expensive in a perspective of bandwidth, and the fact that you have a handful of these files which size adds up to 2MB fairly quickly.  Hope that helps,

    -Elaine

  • Long loading times, XPguest - opensuse 11.1 host

    Ref: workstation 6.5.1

    openSUSE 11.1

    After compiling the modules using the tip of raid3868

    (mv/usr/lib/vmware/modules/binary/usr/lib/vmware/modules/binary_old)

    This is the behavior of VMware

    1. If I load a VM with opensuse 11 (it's just one of the guests I have available) it loads and runs like when I was with opensuse 11 as host. So in my opinion works well

    2. I have that I load a VM with XP, the initial screen of XP is fast and then takes a long time until the final screen comes and XP loads, as if XP is looking for drivers etc.

    After it loads, it works as before (way OK).

    Time of loading for XP using opensuse 11 = 43.5 sec

    Loading time for XP using opensuse 11.1 = 5 min 20 sec.

    What is the best way to open a session to the events I have described? I tried to start mode full screen and the whole system froze and the VM doesn't work anymore, so I had to make a new. I'll try again.

    I'm sure it's a problem with the kernel, and it may also appear in fedora 10 etc. I am interesting to solve because is the only thing now is can't me upgrade to opensuse 11.1

    Happy new year!

    Terry =-

    Post the vmware.log file and the file .vmx since the directory containing your comments.

Maybe you are looking for

  • Why I can't download the new Mac oS Sierra

    I'm trying to download the new oS Mac Sierra and when I try to download it from the App Store I have the following message: This version of macOS 10.12 cannot be installed on this computer. I click on learn more and nothing happens. I currently own i

  • Can not listen using bluetooth headphones with music Apple after updating iOS 10

    I've updated my iPad to iOS 10 Air yesterday. This morning, I plugged my bluetooth headset and tried the Apple music (specifically, the NPR radio station). It sends output to the speakers of the iPad and not the bluetooth headset, and after several a

  • How to block Images on Web sites

    I want to warn the images on some Web sites. I followed the advice with the right button on the Web page, select VIEW PAGE INFO, then media. I check the box that says BLOCK the IMAGES. I expect to see an icon back UP, but it says SAVE AS. It is where

  • Name of the directory and record name

    I would like to take advantage of my name (*) ' C:\Documents and Settings\ * \My Documents\My Notebook. out of the address of the directory. It seems that the computer has taken my name of the user of the computer. I'm afraid that it could be read on

  • STOP 0x07a Lenovo3000 g430 20003

    Hello, everyone.I have laptop Lenovo3000 g430 20003.and I have error KERNEL_DATA_INPAGE_ERROR STOP 0x07a (0xc0000185, 0x55a6b820, 0xc0487F70, 0x90feee7e).I read that 0xC0000185 or STATUS_IO_DEVICE_ERROR, indicates improper termination or defective ca