Skip to content

Adding a progressbar brings the browser to its knees (CPU Load) #12

@slibert

Description

@slibert

Hello,

As stated in the thread https://vaadin.com/forum#!/thread/3433454 there is some high CPU load that kills the browser if you add a progressbar to a wizard's step.

Here is a snippet code :

private class FirstStep implements WizardStep, ProgressListener
{

    Label lblMessage;
    ProgressBar progress;

    RTWorker worker;
    boolean treatmentDone = false;

    @Override
    public String getCaption() {
        return "Simulation";
    }

    @Override
    public Component getContent() 
    {

        VerticalLayout vLayout = new VerticalLayout();
        vLayout.setWidth(100, Unit.PERCENTAGE);
        vLayout.setMargin(true);
        vLayout.setSpacing(true);

        try
        {

            /* Working Hard */
            worker = new RTWorker(); // Thread

            lblMessage = new Label("Working in progress... ");
            vLayout.addComponent(lblMessage);

            progress = new ProgressBar();
            progress.setVisible(true);
            progress.setWidth(500, Unit.PIXELS);
            progress.setHeight(60, Unit.PIXELS);
            progress.setIndeterminate(false);
            progress.setEnabled(true);
            app.setPollInterval(3000);

            vLayout.addComponent(progress);

}

As you can see, I put a really large poll interval, but still, when running, browser is barely responding to my actions.

Tested with last version of Wizard and Vaadin 7.4.3

Regards
Sebastien

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions