Your previous fix works. Now the method takes only 0.6% of the total
execution time.

Azeez

On Tue, Sep 4, 2012 at 8:00 PM, Amani Soysa <[email protected]> wrote:

> I have found a better way of improving the performance of String replace
> by using org.apache.commons.lang.StringUtils.replace(serviceName, "/",
> "");. And attached the jar file and the diff to the jira. For more
> information on String replace performance [1]
>
> [1] -
> http://myhowto.org/under-the-hood/32-hidden-costs-of-using-java-string-methods/
>
>
> On Tue, Sep 4, 2012 at 7:35 PM, Amani Soysa <[email protected]> wrote:
>
>>
>>
>> On Tue, Sep 4, 2012 at 7:18 PM, Afkham Azeez <[email protected]> wrote:
>>
>>> Anyway, how will the following improve performance?
>>>
>>> Java String.replace uses regular expressions and can be slow, especially
>> for large strings requiring many replacements. Therefore, i thought of
>> using substring instead of replace since according to the diagram you've
>> attached overhead of string substring is 0.1% for the same string.  I
>> didn't test this properly however, I will update this thread as soon as I
>> am done.
>>
>> - serviceName = serviceName.replace("/", "");
>>> + serviceName = serviceName.substring(serviceName.indexOf('/')+1,
>>> serviceName.length());
>>>
>>> On Tue, Sep 4, 2012 at 7:15 PM, Afkham Azeez <[email protected]> wrote:
>>>
>>>> I built a tomcat ext jar with your fix & replaced the original, and
>>>> still server hangs at startup.
>>>>
>>>> Azeez
>>>>
>>>>
>>>> On Tue, Sep 4, 2012 at 7:01 PM, Amani Soysa <[email protected]> wrote:
>>>>
>>>>> Yes there's something wrong with the packs coming from the builder ...
>>>>> you need to have your own build .. My fix was a simple fix where i remove
>>>>> the String replace, that should not have any impact on server startup.
>>>>>
>>>>> On Tue, Sep 4, 2012 at 6:44 PM, Amila Maha Arachchi 
>>>>> <[email protected]>wrote:
>>>>>
>>>>>> Did you take a pack from builder and replaced a jar with a one built
>>>>>> in your machine?
>>>>>>
>>>>>> Has it got something to do with the patch or does the bundle does not
>>>>>> get activated? Some of us have faced a problem which the packs built from
>>>>>> the builder doesn't get started when we replace the jars. I have sent a
>>>>>> separate mail regarding this.
>>>>>>
>>>>>> AmilaM.
>>>>>>
>>>>>> On Tue, Sep 4, 2012 at 6:20 PM, Afkham Azeez <[email protected]> wrote:
>>>>>>
>>>>>>> When I applied your patch, and tried to start the server, the server
>>>>>>> does not start.
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Sep 4, 2012 at 3:19 PM, Amani Soysa <[email protected]> wrote:
>>>>>>>
>>>>>>>> Fixed this issue [1]. I have attached the patch to the following
>>>>>>>> jira[1]
>>>>>>>>
>>>>>>>> [1] - https://wso2.org/jira/browse/CARBON-13859
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Sep 4, 2012 at 2:46 PM, Amani Soysa <[email protected]> wrote:
>>>>>>>>
>>>>>>>>> On Tue, Sep 4, 2012 at 2:41 PM, Afkham Azeez <[email protected]>wrote:
>>>>>>>>>
>>>>>>>>>> Amani, Reka,
>>>>>>>>>> Please review the attached screenshot & fix.
>>>>>>>>>>
>>>>>>>>>> Will fix it.
>>>>>>>>>
>>>>>>>>>> Thanks
>>>>>>>>>> Azeez
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> *Afkham Azeez*
>>>>>>>>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>>>>>>>>> Member; Apache Software Foundation; http://www.apache.org/
>>>>>>>>>> * <http://www.apache.org/>**
>>>>>>>>>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>>>>>>>>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>>>>>>>>> twitter: 
>>>>>>>>>> **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>>>>>>>>> *
>>>>>>>>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>>>>>>>>> *
>>>>>>>>>> *
>>>>>>>>>> *Lean . Enterprise . Middleware*
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> *Afkham Azeez*
>>>>>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>>>>>> Member; Apache Software Foundation; http://www.apache.org/
>>>>>>> * <http://www.apache.org/>**
>>>>>>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>>>>>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>>>>>> twitter: 
>>>>>>> **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>>>>>> *
>>>>>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>>>>>> *
>>>>>>> *
>>>>>>> *Lean . Enterprise . Middleware*
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Dev mailing list
>>>>>>> [email protected]
>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> *Amila Maharachchi*
>>>>>> Technical Lead
>>>>>> Member, Management Committee - Cloud & Platform TG
>>>>>> WSO2, Inc.; http://wso2.com
>>>>>>
>>>>>> Blog: http://maharachchi.blogspot.com
>>>>>> Mobile: +94719371446
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> *Afkham Azeez*
>>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>>> Member; Apache Software Foundation; http://www.apache.org/
>>>> * <http://www.apache.org/>**
>>>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>>> twitter: 
>>>> **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>>> *
>>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>>> *
>>>> *
>>>> *Lean . Enterprise . Middleware*
>>>>
>>>>
>>>
>>>
>>> --
>>> *Afkham Azeez*
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; http://www.apache.org/
>>> * <http://www.apache.org/>**
>>> email: **[email protected]* <[email protected]>* cell: +94 77 3320919
>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>> twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>> *
>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>> *
>>> *
>>> *Lean . Enterprise . Middleware*
>>>
>>>
>>
>


-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>**
email: **[email protected]* <[email protected]>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to