You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Oleg Kalnichevski (JIRA)" <ji...@apache.org> on 2007/10/28 11:02:50 UTC
[jira] Commented: (HTTPCORE-126) Improved HTTP message parsing
[ 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: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org