[sip-comm-dev] Re: svn commit: r5942 - trunk/src/net/java/sip/communicator/plugin/branding


#1

Hi fellow developers,

Last night I disabled the splash screen by default in order to cut off
memory at startup and I added a configuration property to enable it
(which you already know if you're on the commits mailing list). It
saves about 5MB of startup process memory on both Ubuntu and Snow
Leopard for me (and it spares some execution time but that wasn't the
goal of my change so I haven't measured it). Anyway, I'm repeating it
here because my hint at applying the change in my "Memory usage" mail
message was too subtle and to invite you to give your opinion about
such a visible change.

Regards,
Lubomir

···

On Fri, Sep 11, 2009 at 12:22 AM, <lubomir_m@dev.java.net> wrote:

Author: lubomir_m
Date: 2009-09-10 21:22:12+0000
New Revision: 5942

Modified:
trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java
trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java
trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java
trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf

Log:
Disables the splash screen by default in order to cut off memory at startup (but it also improves startup time) and adds a configuration property to enable it.

Modified: trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java?view=diff&rev=5942&p1=trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java&p2=trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java&r1=5941&r2=5942

--- trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java (original)
+++ trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java 2009-09-10 21:22:12+0000
@@ -26,9 +26,7 @@
AboutWindow.showAboutWindow();
}

- private final JMenuItem aboutMenuItem
- = new JMenuItem(BrandingActivator.getResources().
- getI18NString("plugin.branding.ABOUT_MENU_ENTRY"));
+ private final JMenuItem aboutMenuItem;

private final Container container;

@@ -36,9 +34,12 @@
{
this.container = c;

- aboutMenuItem.setMnemonic(
- BrandingActivator.getResources().getI18nMnemonic(
- "plugin.branding.ABOUT_MENU_ENTRY"));
+ aboutMenuItem = new JMenuItem(getName());
+ aboutMenuItem
+ .setMnemonic(
+ BrandingActivator
+ .getResources()
+ .getI18nMnemonic("plugin.branding.ABOUT_MENU_ENTRY"));

    aboutMenuItem\.addActionListener\(new ActionListener\(\)
    \{

@@ -66,7 +67,10 @@

public String getName\(\)
\{

- return BrandingActivator.getResources().getI18NString("plugin.branding.ABOUT_MENU_ENTRY");
+ return
+ BrandingActivator
+ .getResources()
+ .getI18NString("plugin.branding.ABOUT_MENU_ENTRY");
}

public void setCurrentContact\(MetaContact metaContact\)

Modified: trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java?view=diff&rev=5942&p1=trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java&p2=trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java&r1=5941&r2=5942

--- trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java (original)
+++ trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java 2009-09-10 21:22:12+0000
@@ -9,6 +9,7 @@
import java.lang.reflect.*;
import java.util.*;

+import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.*;
@@ -16,10 +17,18 @@
import org.osgi.framework.*;

public class BrandingActivator
- implements BundleActivator
+ implements BundleActivator
{
private final Logger logger = Logger.getLogger(BrandingActivator.class);

+ /**
+ * The name of the boolean property which indicates whether the splash
+ * screen (i.e. <code>WelcomeWindow</code>) is to be shown or to not be
+ * utilized for the sake of better memory consumption and faster startup.
+ */
+ private static final String PNAME_SHOW_SPLASH_SCREEN
+ = "net.java.sip.communicator.plugin.branding.SHOW_SPLASH_SCREEN";
+
private static BundleContext bundleContext;

private static ResourceManagementService resourcesService;

@@ -28,6 +37,17 @@
{
bundleContext = bc;

+ ConfigurationService config = getConfigurationService();
+ boolean showSplashScreen
+ = (config == null)
+ ? true /*
+ * Having no ConfigurationService reference is not good
+ * for the application so we are better off with the
+ * splash screen to actually see which bundles get loaded
+ * and maybe be able to debug the problem.
+ */
+ : config.getBoolean(PNAME_SHOW_SPLASH_SCREEN, false);
+
/*
* WelcomeWindow is huge because it has a large image spread all over it
* so, given it's only necessary before the UIService gets activated, we
@@ -35,9 +55,15 @@
* as a final variable used inside a BundleListener which never gets
* removed).
*/
- final WelcomeWindow welcomeWindow = new WelcomeWindow();
- welcomeWindow.pack();
- welcomeWindow.setVisible(true);
+ final WelcomeWindow welcomeWindow;
+ if (showSplashScreen)
+ {
+ welcomeWindow = new WelcomeWindow();
+ welcomeWindow.pack();
+ welcomeWindow.setVisible(true);
+ }
+ else
+ welcomeWindow = null;

    bundleContext\.addBundleListener\(new BundleListener\(\)
    \{

@@ -62,8 +88,8 @@
public void bundleChanged(BundleEvent evt)
{
if (!done
- && !BrandingActivator.this
- .bundleChanged(evt, welcomeWindow))
+ && !BrandingActivator
+ .this.bundleChanged(evt, welcomeWindow))
{

                /\*

@@ -106,14 +132,15 @@
ServiceReference uiServiceRef =
bundleContext.getServiceReference(UIService.class.getName());
if ((uiServiceRef != null)
- && (Bundle.ACTIVE == uiServiceRef.getBundle().getState()))
+ && (Bundle.ACTIVE == uiServiceRef.getBundle().getState()))
{
// UI-Service started.

        // register the about dialog menu entry
        registerMenuEntry\(uiServiceRef\);

- welcomeWindow.close();
+ if (welcomeWindow != null)
+ welcomeWindow.close();

        /\*
         \* We&#39;ve just closed the WelcomeWindow so there&#39;ll be no other

@@ -128,10 +155,12 @@

private void registerMenuEntry\(ServiceReference uiServiceRef\)
\{

- UIService uiService =
- (UIService) bundleContext.getService(uiServiceRef);
- if ((uiService == null) || !uiService.useMacOSXScreenMenuBar()
- || !registerMenuEntryMacOSX(uiService))
+ UIService uiService
+ = (UIService) bundleContext.getService(uiServiceRef);
+
+ if ((uiService == null)
+ || !uiService.useMacOSXScreenMenuBar()
+ || !registerMenuEntryMacOSX(uiService))
{
registerMenuEntryNonMacOSX(uiService);
}
@@ -208,20 +237,22 @@
return bundleContext;
}

+ private static ConfigurationService getConfigurationService()
+ {
+ ServiceReference serRef
+ = bundleContext
+ .getServiceReference(ConfigurationService.class.getName());
+ return
+ (serRef == null)
+ ? null
+ : (ConfigurationService) bundleContext.getService(serRef);
+ }
+
public static ResourceManagementService getResources()
{
if (resourcesService == null)
- {
- ServiceReference serviceReference = bundleContext
- .getServiceReference(ResourceManagementService.class.getName());
-
- if(serviceReference == null)
- return null;
-
- resourcesService = (ResourceManagementService) bundleContext
- .getService(serviceReference);
- }
-
+ resourcesService
+ = ResourceManagementServiceUtils.getService(bundleContext);
return resourcesService;
}
}

Modified: trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java?view=diff&rev=5942&p1=trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java&p2=trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java&r1=5941&r2=5942

--- trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java (original)
+++ trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java 2009-09-10 21:22:12+0000
@@ -14,6 +14,7 @@
import javax.imageio.*;
import javax.swing.*;

+import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.swing.*;

/**
@@ -25,10 +26,6 @@
*/
public class WelcomeWindow extends JDialog
{
- private static final int PREFERRED_WIDTH = 570;
-
- private static final int PREFERRED_HEIGHT = 330;
-
private static final String APPLICATION_NAME
= BrandingActivator.getResources()
.getSettingsString("service.gui.APPLICATION_NAME");
@@ -37,13 +34,11 @@
= BrandingActivator.getResources()
.getSettingsInt("plugin.branding.SPLASH_SCREEN_TEXT_INDENT");

- private final JLabel loadingLabel = new JLabel(
- BrandingActivator.getResources()
- .getI18NString("plugin.branding.LOADING") + ": ");
+ private static final int PREFERRED_HEIGHT = 330;

- private final JLabel bundleLabel = new JLabel();
+ private static final int PREFERRED_WIDTH = 570;

- private final JPanel loadingPanel = new JPanel(new BorderLayout());
+ private final JLabel bundleLabel = new JLabel();

public WelcomeWindow\(\)
\{

@@ -87,7 +82,7 @@

    this\.initLicenseArea\(licenseArea\);

- this.initLoadingPanel();
+ Component loadingPanel = initLoadingPanel();

    textPanel\.add\(titleLabel\);
    textPanel\.add\(versionLabel\);

@@ -212,29 +207,38 @@
licenseArea.setAlignmentX(Component.RIGHT_ALIGNMENT);
}

- private void initLoadingPanel()
+ private JPanel initLoadingPanel()
{
+ ResourceManagementService resources = BrandingActivator.getResources();
+ JLabel loadingLabel
+ = new JLabel(
+ resources.getI18NString("plugin.branding.LOADING") + ": ");
+ JPanel loadingPanel = new JPanel(new BorderLayout());
+
this.bundleLabel.setFont(loadingLabel.getFont().deriveFont(Font.PLAIN));
- this.loadingPanel.setOpaque(false);
- this.loadingPanel.add(loadingLabel, BorderLayout.WEST);
- this.loadingPanel.add(bundleLabel, BorderLayout.CENTER);
+
+ loadingPanel.setOpaque(false);
+ loadingPanel.add(loadingLabel, BorderLayout.WEST);
+ loadingPanel.add(bundleLabel, BorderLayout.CENTER);

    int loadingPanelBorder

- = BrandingActivator.getResources()
+ = resources
.getSettingsInt("plugin.branding.LOADING_BUNDLE_PANEL_BORDER");

- this.loadingPanel.setBorder(
+ loadingPanel.setBorder(
BorderFactory.createEmptyBorder(loadingPanelBorder,
loadingPanelBorder,
loadingPanelBorder,
loadingPanelBorder));

    int loadingPanelHeight

- = BrandingActivator.getResources()
+ = resources
.getSettingsInt("plugin.branding.LOADING_BUNDLE_PANEL_HEIGHT");

- this.loadingPanel.setPreferredSize(
+ loadingPanel.setPreferredSize(
new Dimension(PREFERRED_WIDTH, loadingPanelHeight));
+
+ return loadingPanel;
}

/\*\*

@@ -278,10 +282,10 @@
*/
public void setBundle(String bundleName)
{
- this.bundleLabel.setText(bundleName);
+ bundleLabel.setText(bundleName);

- this.loadingPanel.revalidate();
- this.loadingPanel.repaint();
+ bundleLabel.revalidate();
+ bundleLabel.getParent().repaint();
}

/\*\*

Modified: trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf?view=diff&rev=5942&p1=trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf&p2=trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf&r1=5941&r2=5942

--- trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf (original)
+++ trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf 2009-09-10 21:22:12+0000
@@ -6,6 +6,7 @@
System-Bundle: yes
Import-Package: org.osgi.framework,
net.java.sip.communicator.service.browserlauncher,
+ net.java.sip.communicator.service.configuration,
net.java.sip.communicator.service.resources,
net.java.sip.communicator.service.gui,
net.java.sip.communicator.service.gui.event,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#2

Thanks Lubo,

All, if at some point someone feels like measuring the new startup time,
I'd be curious to know how we do now.

Cheers,
Emil

Lubomir Marinov wrote:

···

Hi fellow developers,

Last night I disabled the splash screen by default in order to cut off
memory at startup and I added a configuration property to enable it
(which you already know if you're on the commits mailing list). It
saves about 5MB of startup process memory on both Ubuntu and Snow
Leopard for me (and it spares some execution time but that wasn't the
goal of my change so I haven't measured it). Anyway, I'm repeating it
here because my hint at applying the change in my "Memory usage" mail
message was too subtle and to invite you to give your opinion about
such a visible change.

Regards,
Lubomir

On Fri, Sep 11, 2009 at 12:22 AM, <lubomir_m@dev.java.net> wrote:

Author: lubomir_m
Date: 2009-09-10 21:22:12+0000
New Revision: 5942

Modified:
  trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java
  trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java
  trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java
  trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf

Log:
Disables the splash screen by default in order to cut off memory at startup (but it also improves startup time) and adds a configuration property to enable it.

Modified: trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java?view=diff&rev=5942&p1=trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java&p2=trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java&r1=5941&r2=5942

--- trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java (original)
+++ trunk/src/net/java/sip/communicator/plugin/branding/AboutWindowPluginComponent.java 2009-09-10 21:22:12+0000
@@ -26,9 +26,7 @@
        AboutWindow.showAboutWindow();
    }

- private final JMenuItem aboutMenuItem
- = new JMenuItem(BrandingActivator.getResources().
- getI18NString("plugin.branding.ABOUT_MENU_ENTRY"));
+ private final JMenuItem aboutMenuItem;

    private final Container container;

@@ -36,9 +34,12 @@
    {
        this.container = c;

- aboutMenuItem.setMnemonic(
- BrandingActivator.getResources().getI18nMnemonic(
- "plugin.branding.ABOUT_MENU_ENTRY"));
+ aboutMenuItem = new JMenuItem(getName());
+ aboutMenuItem
+ .setMnemonic(
+ BrandingActivator
+ .getResources()
+ .getI18nMnemonic("plugin.branding.ABOUT_MENU_ENTRY"));

        aboutMenuItem.addActionListener(new ActionListener()
        {
@@ -66,7 +67,10 @@

    public String getName()
    {
- return BrandingActivator.getResources().getI18NString("plugin.branding.ABOUT_MENU_ENTRY");
+ return
+ BrandingActivator
+ .getResources()
+ .getI18NString("plugin.branding.ABOUT_MENU_ENTRY");
    }

    public void setCurrentContact(MetaContact metaContact)

Modified: trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java?view=diff&rev=5942&p1=trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java&p2=trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java&r1=5941&r2=5942

--- trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java (original)
+++ trunk/src/net/java/sip/communicator/plugin/branding/BrandingActivator.java 2009-09-10 21:22:12+0000
@@ -9,6 +9,7 @@
import java.lang.reflect.*;
import java.util.*;

+import net.java.sip.communicator.service.configuration.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.*;
@@ -16,10 +17,18 @@
import org.osgi.framework.*;

public class BrandingActivator
- implements BundleActivator
+ implements BundleActivator
{
    private final Logger logger = Logger.getLogger(BrandingActivator.class);

+ /**
+ * The name of the boolean property which indicates whether the splash
+ * screen (i.e. <code>WelcomeWindow</code>) is to be shown or to not be
+ * utilized for the sake of better memory consumption and faster startup.
+ */
+ private static final String PNAME_SHOW_SPLASH_SCREEN
+ = "net.java.sip.communicator.plugin.branding.SHOW_SPLASH_SCREEN";
+
    private static BundleContext bundleContext;

    private static ResourceManagementService resourcesService;
@@ -28,6 +37,17 @@
    {
        bundleContext = bc;

+ ConfigurationService config = getConfigurationService();
+ boolean showSplashScreen
+ = (config == null)
+ ? true /*
+ * Having no ConfigurationService reference is not good
+ * for the application so we are better off with the
+ * splash screen to actually see which bundles get loaded
+ * and maybe be able to debug the problem.
+ */
+ : config.getBoolean(PNAME_SHOW_SPLASH_SCREEN, false);
+
        /*
         * WelcomeWindow is huge because it has a large image spread all over it
         * so, given it's only necessary before the UIService gets activated, we
@@ -35,9 +55,15 @@
         * as a final variable used inside a BundleListener which never gets
         * removed).
         */
- final WelcomeWindow welcomeWindow = new WelcomeWindow();
- welcomeWindow.pack();
- welcomeWindow.setVisible(true);
+ final WelcomeWindow welcomeWindow;
+ if (showSplashScreen)
+ {
+ welcomeWindow = new WelcomeWindow();
+ welcomeWindow.pack();
+ welcomeWindow.setVisible(true);
+ }
+ else
+ welcomeWindow = null;

        bundleContext.addBundleListener(new BundleListener()
        {
@@ -62,8 +88,8 @@
            public void bundleChanged(BundleEvent evt)
            {
                if (!done
- && !BrandingActivator.this
- .bundleChanged(evt, welcomeWindow))
+ && !BrandingActivator
+ .this.bundleChanged(evt, welcomeWindow))
                {

                    /*
@@ -106,14 +132,15 @@
        ServiceReference uiServiceRef =
            bundleContext.getServiceReference(UIService.class.getName());
        if ((uiServiceRef != null)
- && (Bundle.ACTIVE == uiServiceRef.getBundle().getState()))
+ && (Bundle.ACTIVE == uiServiceRef.getBundle().getState()))
        {
            // UI-Service started.

            // register the about dialog menu entry
            registerMenuEntry(uiServiceRef);

- welcomeWindow.close();
+ if (welcomeWindow != null)
+ welcomeWindow.close();

            /*
             * We've just closed the WelcomeWindow so there'll be no other
@@ -128,10 +155,12 @@

    private void registerMenuEntry(ServiceReference uiServiceRef)
    {
- UIService uiService =
- (UIService) bundleContext.getService(uiServiceRef);
- if ((uiService == null) || !uiService.useMacOSXScreenMenuBar()
- || !registerMenuEntryMacOSX(uiService))
+ UIService uiService
+ = (UIService) bundleContext.getService(uiServiceRef);
+
+ if ((uiService == null)
+ || !uiService.useMacOSXScreenMenuBar()
+ || !registerMenuEntryMacOSX(uiService))
        {
            registerMenuEntryNonMacOSX(uiService);
        }
@@ -208,20 +237,22 @@
        return bundleContext;
    }

+ private static ConfigurationService getConfigurationService()
+ {
+ ServiceReference serRef
+ = bundleContext
+ .getServiceReference(ConfigurationService.class.getName());
+ return
+ (serRef == null)
+ ? null
+ : (ConfigurationService) bundleContext.getService(serRef);
+ }
+
    public static ResourceManagementService getResources()
    {
        if (resourcesService == null)
- {
- ServiceReference serviceReference = bundleContext
- .getServiceReference(ResourceManagementService.class.getName());
-
- if(serviceReference == null)
- return null;
-
- resourcesService = (ResourceManagementService) bundleContext
- .getService(serviceReference);
- }
-
+ resourcesService
+ = ResourceManagementServiceUtils.getService(bundleContext);
        return resourcesService;
    }
}

Modified: trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java?view=diff&rev=5942&p1=trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java&p2=trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java&r1=5941&r2=5942

--- trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java (original)
+++ trunk/src/net/java/sip/communicator/plugin/branding/WelcomeWindow.java 2009-09-10 21:22:12+0000
@@ -14,6 +14,7 @@
import javax.imageio.*;
import javax.swing.*;

+import net.java.sip.communicator.service.resources.*;
import net.java.sip.communicator.util.swing.*;

/**
@@ -25,10 +26,6 @@
*/
public class WelcomeWindow extends JDialog
{
- private static final int PREFERRED_WIDTH = 570;
-
- private static final int PREFERRED_HEIGHT = 330;
-
    private static final String APPLICATION_NAME
        = BrandingActivator.getResources()
            .getSettingsString("service.gui.APPLICATION_NAME");
@@ -37,13 +34,11 @@
        = BrandingActivator.getResources()
            .getSettingsInt("plugin.branding.SPLASH_SCREEN_TEXT_INDENT");

- private final JLabel loadingLabel = new JLabel(
- BrandingActivator.getResources()
- .getI18NString("plugin.branding.LOADING") + ": ");
+ private static final int PREFERRED_HEIGHT = 330;

- private final JLabel bundleLabel = new JLabel();
+ private static final int PREFERRED_WIDTH = 570;

- private final JPanel loadingPanel = new JPanel(new BorderLayout());
+ private final JLabel bundleLabel = new JLabel();

    public WelcomeWindow()
    {
@@ -87,7 +82,7 @@

        this.initLicenseArea(licenseArea);

- this.initLoadingPanel();
+ Component loadingPanel = initLoadingPanel();

        textPanel.add(titleLabel);
        textPanel.add(versionLabel);
@@ -212,29 +207,38 @@
        licenseArea.setAlignmentX(Component.RIGHT_ALIGNMENT);
    }

- private void initLoadingPanel()
+ private JPanel initLoadingPanel()
    {
+ ResourceManagementService resources = BrandingActivator.getResources();
+ JLabel loadingLabel
+ = new JLabel(
+ resources.getI18NString("plugin.branding.LOADING") + ": ");
+ JPanel loadingPanel = new JPanel(new BorderLayout());
+
        this.bundleLabel.setFont(loadingLabel.getFont().deriveFont(Font.PLAIN));
- this.loadingPanel.setOpaque(false);
- this.loadingPanel.add(loadingLabel, BorderLayout.WEST);
- this.loadingPanel.add(bundleLabel, BorderLayout.CENTER);
+
+ loadingPanel.setOpaque(false);
+ loadingPanel.add(loadingLabel, BorderLayout.WEST);
+ loadingPanel.add(bundleLabel, BorderLayout.CENTER);

        int loadingPanelBorder
- = BrandingActivator.getResources()
+ = resources
                .getSettingsInt("plugin.branding.LOADING_BUNDLE_PANEL_BORDER");

- this.loadingPanel.setBorder(
+ loadingPanel.setBorder(
            BorderFactory.createEmptyBorder(loadingPanelBorder,
                                            loadingPanelBorder,
                                            loadingPanelBorder,
                                            loadingPanelBorder));

        int loadingPanelHeight
- = BrandingActivator.getResources()
+ = resources
                .getSettingsInt("plugin.branding.LOADING_BUNDLE_PANEL_HEIGHT");

- this.loadingPanel.setPreferredSize(
+ loadingPanel.setPreferredSize(
            new Dimension(PREFERRED_WIDTH, loadingPanelHeight));
+
+ return loadingPanel;
    }

    /**
@@ -278,10 +282,10 @@
     */
    public void setBundle(String bundleName)
    {
- this.bundleLabel.setText(bundleName);
+ bundleLabel.setText(bundleName);

- this.loadingPanel.revalidate();
- this.loadingPanel.repaint();
+ bundleLabel.revalidate();
+ bundleLabel.getParent().repaint();
    }

    /**

Modified: trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf
Url: https://sip-communicator.dev.java.net/source/browse/sip-communicator/trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf?view=diff&rev=5942&p1=trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf&p2=trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf&r1=5941&r2=5942

--- trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf (original)
+++ trunk/src/net/java/sip/communicator/plugin/branding/branding.manifest.mf 2009-09-10 21:22:12+0000
@@ -6,6 +6,7 @@
System-Bundle: yes
Import-Package: org.osgi.framework,
net.java.sip.communicator.service.browserlauncher,
+ net.java.sip.communicator.service.configuration,
net.java.sip.communicator.service.resources,
net.java.sip.communicator.service.gui,
net.java.sip.communicator.service.gui.event,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

--
Emil Ivov, Ph.D. 67000 Strasbourg,
Project Lead France
SIP Communicator
emcho@sip-communicator.org PHONE: +33.1.77.62.43.30
http://sip-communicator.org FAX: +33.1.77.62.47.31

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Lubomir, Emil, all,

I've run the Instruments tool of Mac OS X (Leopard for me), to measure general memory usage of any executable.
I got some results (attached) in testing both build 2024 (splash) and 2025 (no-splash).

Obviously, the Instruments tool measured more objects allocations for build 2024 at startup.
(see attached, before SC main frame appears. I'm sorry but I didn't any way to display the scale for the graph, so I hope it will be quite useful).

Regarding to the time, I've noticed a 2 or 3 seconds gain, never more.

Regards,
Valentin


#4

Hi Valentin,

Thank you for the feedback!

I've only used Instruments to analyze native allocations of
applications and trace native calls. I thought I'd use it for the task
at hand at some point but I'm still mostly focused on not growing the
Java heap too much and the allocations in it should (generally
speaking) not appear as native allocations anyway.

As to the 2 or 3 seconds gained on startup, I think when sparing
seconds as opposed to mere milliseconds and especially on startup is
quite a gain.

Thank you,
Lubomir

···

On Fri, Sep 11, 2009 at 1:20 PM, Valentin MARTINET <vmartinet.sipcommunicator@gmail.com> wrote:

Hi Lubomir, Emil, all,

I've run the Instruments tool of Mac OS X (Leopard for me), to measure
general memory usage of any executable.
I got some results (attached) in testing both build 2024 (splash) and 2025
(no-splash).

Obviously, the Instruments tool measured more objects allocations for build
2024 at startup.
(see attached, before SC main frame appears. I'm sorry but I didn't any way
to display the scale for the graph, so I hope it will be quite useful).

Regarding to the time, I've noticed a 2 or 3 seconds gain, never more.

Regards,
Valentin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net