[ 
https://issues.apache.org/jira/browse/HTTPCORE-126?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12538296
 ] 

Oleg Kalnichevski commented on HTTPCORE-126:
--------------------------------------------

I completed the refactoring of the HeaderValueParser and so far the results 
look pretty promising to me. The code got much cleaner and nicer. So did the 
API. On top of that I am seeing almost 40% performance improvement compared to 
the old code using this, I admit, very unscientific benchmark:
==================================================
        String s = 
            "name1 = \"value1\"; param1 = \"pvalue1\" ; param2 = \"pvalue2\" ," 
+
            "name2 = \"value2\"; param1 = \"pvalue1\" ; param2 = \"pvalue2\" ," 
+
            "name3 = \"value3\"; param1 = \"pvalue1\" ; param2 = \"pvalue2\"";
        
        CharArrayBuffer buffer = new CharArrayBuffer(64);
        buffer.append(s);
        
        HeaderValueParser parser = BasicHeaderValueParser.DEFAULT;
        
        long start = System.currentTimeMillis();
        for (int i = 0; i < 1000000; i++) {
            parser.parseElements(buffer, 0, s.length());
        }
        long finish = System.currentTimeMillis();
        System.out.println(finish - start);
==================================================

Overall it was well worth the effort.

Roland, could you please review the changes at a time of your convenience? 

You can switch to the branch by calling this command:

svn sw 
https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpcore/branches/parser_refactoring

I'll prepare a patch in a few minutes.

Oleg 

> Improved HTTP message parsing
> -----------------------------
>
>                 Key: HTTPCORE-126
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-126
>             Project: HttpComponents Core
>          Issue Type: Improvement
>    Affects Versions: 4.0-alpha6
>            Reporter: Oleg Kalnichevski
>             Fix For: 4.0-beta1
>
>
> Implement a more flexible HTTP message parsing API that eliminates the need 
> to skip back during the parsing process thus potentially improving 
> performance.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to