You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Valentin Valchev (JIRA)" <ji...@apache.org> on 2010/04/14 14:20:52 UTC

[jira] Created: (FELIX-2282) Optimize Services Printer

Optimize Services Printer
-------------------------

                 Key: FELIX-2282
                 URL: https://issues.apache.org/jira/browse/FELIX-2282
             Project: Felix
          Issue Type: Improvement
    Affects Versions: webconsole-3.0.0
            Reporter: Valentin Valchev
             Fix For: webconsole-3.0.2
         Attachments: ServicesConfigurationPrinter.java

When navigating through the Configuration Status tabs, the Services is a little bit slower than others (except Bundles, which is the slowest). I look at the code and it might be improved, to make is faster.

It seems that implementation now is so slow because first it renders to JSON and then converts he data to text.

A significant optimization can be achieved if:
1. Skip to JSON conversion - generate the text directly from the service references.
2. Improve usage of message formatter by using pre-parsed formatters:
{code}
final MessageFormat format = new MessageFormat(pattern);
..
format.format(object[])
{code}
instead of 
{code}
MessageFormat.format(pattern, object[])
{code}
3. reuse one Object[] for MessageFormat - this will reduce the temporary objects

---
I've also created a prototype and the performance improvement is even visible while browsing the tabs. The measured results are:
ServicesServlet.printConfiguration(): now = 250
ServicesConfigurationPrinter.printConfiguration(): now = 140
ServicesServlet.printConfiguration(): now = 250
ServicesConfigurationPrinter.printConfiguration(): now = 141
ServicesServlet.printConfiguration(): now = 265
ServicesConfigurationPrinter.printConfiguration(): now = 125
ServicesServlet.printConfiguration(): now = 250

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (FELIX-2282) Optimize Services Printer

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Valentin Valchev reassigned FELIX-2282:
---------------------------------------

    Assignee: Valentin Valchev

> Optimize Services Printer
> -------------------------
>
>                 Key: FELIX-2282
>                 URL: https://issues.apache.org/jira/browse/FELIX-2282
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Valentin Valchev
>            Assignee: Valentin Valchev
>             Fix For: webconsole-3.0.2
>
>         Attachments: ServicesConfigurationPrinter.java
>
>
> When navigating through the Configuration Status tabs, the Services is a little bit slower than others (except Bundles, which is the slowest). I look at the code and it might be improved, to make is faster.
> It seems that implementation now is so slow because first it renders to JSON and then converts he data to text.
> A significant optimization can be achieved if:
> 1. Skip to JSON conversion - generate the text directly from the service references.
> 2. Improve usage of message formatter by using pre-parsed formatters:
> final MessageFormat format = new MessageFormat(pattern);
> ..
> format.format(object[])
> instead of: MessageFormat.format(pattern, object[])
> 3. reuse one Object[] for MessageFormat - this will reduce the temporary objects
> ---
> I've also created a prototype and the performance improvement is even visible while browsing the tabs. The measured results are:
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 140
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 141
> ServicesServlet.printConfiguration(): now = 265
> ServicesConfigurationPrinter.printConfiguration(): now = 125
> ServicesServlet.printConfiguration(): now = 250

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (FELIX-2282) Optimize Services Printer

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12857208#action_12857208 ] 

Valentin Valchev commented on FELIX-2282:
-----------------------------------------

I've committed the optimized version.
Now the printer is in separate class.

I'm just wandering what to do with the ServicesServlet.getStatusLine() method. Actually, the plugin (I mean javascript) no longer uses the "status" field, from the JSON data. It uses the serviceCount, to generate localized status message.

So this method is can be moved to the new ServicesConfigurationPrinter.

But if we move it there, and remove the "status" from JSON data, then we might break some other bundle. As example, someone did alternative UI for webconsole, but still needs it's JSON serialization data and reads that "status" field.

To remove or not to remove - that is question;)
So, WDYT?

> Optimize Services Printer
> -------------------------
>
>                 Key: FELIX-2282
>                 URL: https://issues.apache.org/jira/browse/FELIX-2282
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Valentin Valchev
>             Fix For: webconsole-3.0.2
>
>         Attachments: ServicesConfigurationPrinter.java
>
>
> When navigating through the Configuration Status tabs, the Services is a little bit slower than others (except Bundles, which is the slowest). I look at the code and it might be improved, to make is faster.
> It seems that implementation now is so slow because first it renders to JSON and then converts he data to text.
> A significant optimization can be achieved if:
> 1. Skip to JSON conversion - generate the text directly from the service references.
> 2. Improve usage of message formatter by using pre-parsed formatters:
> final MessageFormat format = new MessageFormat(pattern);
> ..
> format.format(object[])
> instead of: MessageFormat.format(pattern, object[])
> 3. reuse one Object[] for MessageFormat - this will reduce the temporary objects
> ---
> I've also created a prototype and the performance improvement is even visible while browsing the tabs. The measured results are:
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 140
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 141
> ServicesServlet.printConfiguration(): now = 265
> ServicesConfigurationPrinter.printConfiguration(): now = 125
> ServicesServlet.printConfiguration(): now = 250

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (FELIX-2282) Optimize Services Printer

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Valentin Valchev updated FELIX-2282:
------------------------------------

    Description: 
When navigating through the Configuration Status tabs, the Services is a little bit slower than others (except Bundles, which is the slowest). I look at the code and it might be improved, to make is faster.

It seems that implementation now is so slow because first it renders to JSON and then converts he data to text.

A significant optimization can be achieved if:
1. Skip to JSON conversion - generate the text directly from the service references.
2. Improve usage of message formatter by using pre-parsed formatters:

final MessageFormat format = new MessageFormat(pattern);
..
format.format(object[])


instead of: MessageFormat.format(pattern, object[])

3. reuse one Object[] for MessageFormat - this will reduce the temporary objects

---
I've also created a prototype and the performance improvement is even visible while browsing the tabs. The measured results are:
ServicesServlet.printConfiguration(): now = 250
ServicesConfigurationPrinter.printConfiguration(): now = 140
ServicesServlet.printConfiguration(): now = 250
ServicesConfigurationPrinter.printConfiguration(): now = 141
ServicesServlet.printConfiguration(): now = 265
ServicesConfigurationPrinter.printConfiguration(): now = 125
ServicesServlet.printConfiguration(): now = 250

  was:
When navigating through the Configuration Status tabs, the Services is a little bit slower than others (except Bundles, which is the slowest). I look at the code and it might be improved, to make is faster.

It seems that implementation now is so slow because first it renders to JSON and then converts he data to text.

A significant optimization can be achieved if:
1. Skip to JSON conversion - generate the text directly from the service references.
2. Improve usage of message formatter by using pre-parsed formatters:
{code}
final MessageFormat format = new MessageFormat(pattern);
..
format.format(object[])
{code}
instead of 
{code}
MessageFormat.format(pattern, object[])
{code}
3. reuse one Object[] for MessageFormat - this will reduce the temporary objects

---
I've also created a prototype and the performance improvement is even visible while browsing the tabs. The measured results are:
ServicesServlet.printConfiguration(): now = 250
ServicesConfigurationPrinter.printConfiguration(): now = 140
ServicesServlet.printConfiguration(): now = 250
ServicesConfigurationPrinter.printConfiguration(): now = 141
ServicesServlet.printConfiguration(): now = 265
ServicesConfigurationPrinter.printConfiguration(): now = 125
ServicesServlet.printConfiguration(): now = 250


> Optimize Services Printer
> -------------------------
>
>                 Key: FELIX-2282
>                 URL: https://issues.apache.org/jira/browse/FELIX-2282
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Valentin Valchev
>             Fix For: webconsole-3.0.2
>
>         Attachments: ServicesConfigurationPrinter.java
>
>
> When navigating through the Configuration Status tabs, the Services is a little bit slower than others (except Bundles, which is the slowest). I look at the code and it might be improved, to make is faster.
> It seems that implementation now is so slow because first it renders to JSON and then converts he data to text.
> A significant optimization can be achieved if:
> 1. Skip to JSON conversion - generate the text directly from the service references.
> 2. Improve usage of message formatter by using pre-parsed formatters:
> final MessageFormat format = new MessageFormat(pattern);
> ..
> format.format(object[])
> instead of: MessageFormat.format(pattern, object[])
> 3. reuse one Object[] for MessageFormat - this will reduce the temporary objects
> ---
> I've also created a prototype and the performance improvement is even visible while browsing the tabs. The measured results are:
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 140
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 141
> ServicesServlet.printConfiguration(): now = 265
> ServicesConfigurationPrinter.printConfiguration(): now = 125
> ServicesServlet.printConfiguration(): now = 250

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (FELIX-2282) Optimize Services Printer

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger updated FELIX-2282:
-------------------------------------

    Affects Version/s: webconsole-3.1.0
                           (was: webconsole-3.0.0)

> Optimize Services Printer
> -------------------------
>
>                 Key: FELIX-2282
>                 URL: https://issues.apache.org/jira/browse/FELIX-2282
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.1.0
>            Reporter: Valentin Valchev
>            Assignee: Valentin Valchev
>             Fix For: webconsole-3.1.2
>
>         Attachments: ServicesConfigurationPrinter.java
>
>
> When navigating through the Configuration Status tabs, the Services is a little bit slower than others (except Bundles, which is the slowest). I look at the code and it might be improved, to make is faster.
> It seems that implementation now is so slow because first it renders to JSON and then converts he data to text.
> A significant optimization can be achieved if:
> 1. Skip to JSON conversion - generate the text directly from the service references.
> 2. Improve usage of message formatter by using pre-parsed formatters:
> final MessageFormat format = new MessageFormat(pattern);
> ..
> format.format(object[])
> instead of: MessageFormat.format(pattern, object[])
> 3. reuse one Object[] for MessageFormat - this will reduce the temporary objects
> ---
> I've also created a prototype and the performance improvement is even visible while browsing the tabs. The measured results are:
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 140
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 141
> ServicesServlet.printConfiguration(): now = 265
> ServicesConfigurationPrinter.printConfiguration(): now = 125
> ServicesServlet.printConfiguration(): now = 250

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-2282) Optimize Services Printer

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Guillaume Nodet updated FELIX-2282:
-----------------------------------

    Fix Version/s: webconsole-3.1.2
                       (was: webconsole-3.1.0)

> Optimize Services Printer
> -------------------------
>
>                 Key: FELIX-2282
>                 URL: https://issues.apache.org/jira/browse/FELIX-2282
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Valentin Valchev
>            Assignee: Valentin Valchev
>             Fix For: webconsole-3.1.2
>
>         Attachments: ServicesConfigurationPrinter.java
>
>
> When navigating through the Configuration Status tabs, the Services is a little bit slower than others (except Bundles, which is the slowest). I look at the code and it might be improved, to make is faster.
> It seems that implementation now is so slow because first it renders to JSON and then converts he data to text.
> A significant optimization can be achieved if:
> 1. Skip to JSON conversion - generate the text directly from the service references.
> 2. Improve usage of message formatter by using pre-parsed formatters:
> final MessageFormat format = new MessageFormat(pattern);
> ..
> format.format(object[])
> instead of: MessageFormat.format(pattern, object[])
> 3. reuse one Object[] for MessageFormat - this will reduce the temporary objects
> ---
> I've also created a prototype and the performance improvement is even visible while browsing the tabs. The measured results are:
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 140
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 141
> ServicesServlet.printConfiguration(): now = 265
> ServicesConfigurationPrinter.printConfiguration(): now = 125
> ServicesServlet.printConfiguration(): now = 250

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-2282) Optimize Services Printer

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Valentin Valchev updated FELIX-2282:
------------------------------------

    Attachment: ServicesConfigurationPrinter.java

> Optimize Services Printer
> -------------------------
>
>                 Key: FELIX-2282
>                 URL: https://issues.apache.org/jira/browse/FELIX-2282
>             Project: Felix
>          Issue Type: Improvement
>    Affects Versions: webconsole-3.0.0
>            Reporter: Valentin Valchev
>             Fix For: webconsole-3.0.2
>
>         Attachments: ServicesConfigurationPrinter.java
>
>
> When navigating through the Configuration Status tabs, the Services is a little bit slower than others (except Bundles, which is the slowest). I look at the code and it might be improved, to make is faster.
> It seems that implementation now is so slow because first it renders to JSON and then converts he data to text.
> A significant optimization can be achieved if:
> 1. Skip to JSON conversion - generate the text directly from the service references.
> 2. Improve usage of message formatter by using pre-parsed formatters:
> {code}
> final MessageFormat format = new MessageFormat(pattern);
> ..
> format.format(object[])
> {code}
> instead of 
> {code}
> MessageFormat.format(pattern, object[])
> {code}
> 3. reuse one Object[] for MessageFormat - this will reduce the temporary objects
> ---
> I've also created a prototype and the performance improvement is even visible while browsing the tabs. The measured results are:
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 140
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 141
> ServicesServlet.printConfiguration(): now = 265
> ServicesConfigurationPrinter.printConfiguration(): now = 125
> ServicesServlet.printConfiguration(): now = 250

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (FELIX-2282) Optimize Services Printer

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger closed FELIX-2282.
------------------------------------


Apache Felix Web Console 3.1.2 has been released. The issues are now closed.

> Optimize Services Printer
> -------------------------
>
>                 Key: FELIX-2282
>                 URL: https://issues.apache.org/jira/browse/FELIX-2282
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.1.0
>            Reporter: Valentin Valchev
>            Assignee: Valentin Valchev
>             Fix For: webconsole-3.1.2
>
>         Attachments: ServicesConfigurationPrinter.java
>
>
> When navigating through the Configuration Status tabs, the Services is a little bit slower than others (except Bundles, which is the slowest). I look at the code and it might be improved, to make is faster.
> It seems that implementation now is so slow because first it renders to JSON and then converts he data to text.
> A significant optimization can be achieved if:
> 1. Skip to JSON conversion - generate the text directly from the service references.
> 2. Improve usage of message formatter by using pre-parsed formatters:
> final MessageFormat format = new MessageFormat(pattern);
> ..
> format.format(object[])
> instead of: MessageFormat.format(pattern, object[])
> 3. reuse one Object[] for MessageFormat - this will reduce the temporary objects
> ---
> I've also created a prototype and the performance improvement is even visible while browsing the tabs. The measured results are:
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 140
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 141
> ServicesServlet.printConfiguration(): now = 265
> ServicesConfigurationPrinter.printConfiguration(): now = 125
> ServicesServlet.printConfiguration(): now = 250

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-2282) Optimize Services Printer

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Felix Meschberger resolved FELIX-2282.
--------------------------------------

    Resolution: Fixed

I think this can be resolved.

> Optimize Services Printer
> -------------------------
>
>                 Key: FELIX-2282
>                 URL: https://issues.apache.org/jira/browse/FELIX-2282
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.1.0
>            Reporter: Valentin Valchev
>            Assignee: Valentin Valchev
>             Fix For: webconsole-3.1.2
>
>         Attachments: ServicesConfigurationPrinter.java
>
>
> When navigating through the Configuration Status tabs, the Services is a little bit slower than others (except Bundles, which is the slowest). I look at the code and it might be improved, to make is faster.
> It seems that implementation now is so slow because first it renders to JSON and then converts he data to text.
> A significant optimization can be achieved if:
> 1. Skip to JSON conversion - generate the text directly from the service references.
> 2. Improve usage of message formatter by using pre-parsed formatters:
> final MessageFormat format = new MessageFormat(pattern);
> ..
> format.format(object[])
> instead of: MessageFormat.format(pattern, object[])
> 3. reuse one Object[] for MessageFormat - this will reduce the temporary objects
> ---
> I've also created a prototype and the performance improvement is even visible while browsing the tabs. The measured results are:
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 140
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 141
> ServicesServlet.printConfiguration(): now = 265
> ServicesConfigurationPrinter.printConfiguration(): now = 125
> ServicesServlet.printConfiguration(): now = 250

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-2282) Optimize Services Printer

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-2282?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Valentin Valchev updated FELIX-2282:
------------------------------------

    Component/s: Web Console

> Optimize Services Printer
> -------------------------
>
>                 Key: FELIX-2282
>                 URL: https://issues.apache.org/jira/browse/FELIX-2282
>             Project: Felix
>          Issue Type: Improvement
>          Components: Web Console
>    Affects Versions: webconsole-3.0.0
>            Reporter: Valentin Valchev
>             Fix For: webconsole-3.0.2
>
>         Attachments: ServicesConfigurationPrinter.java
>
>
> When navigating through the Configuration Status tabs, the Services is a little bit slower than others (except Bundles, which is the slowest). I look at the code and it might be improved, to make is faster.
> It seems that implementation now is so slow because first it renders to JSON and then converts he data to text.
> A significant optimization can be achieved if:
> 1. Skip to JSON conversion - generate the text directly from the service references.
> 2. Improve usage of message formatter by using pre-parsed formatters:
> {code}
> final MessageFormat format = new MessageFormat(pattern);
> ..
> format.format(object[])
> {code}
> instead of 
> {code}
> MessageFormat.format(pattern, object[])
> {code}
> 3. reuse one Object[] for MessageFormat - this will reduce the temporary objects
> ---
> I've also created a prototype and the performance improvement is even visible while browsing the tabs. The measured results are:
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 140
> ServicesServlet.printConfiguration(): now = 250
> ServicesConfigurationPrinter.printConfiguration(): now = 141
> ServicesServlet.printConfiguration(): now = 265
> ServicesConfigurationPrinter.printConfiguration(): now = 125
> ServicesServlet.printConfiguration(): now = 250

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira