Cookie Parsing
JavaScript performance comparison
Info
Comparing two RegExp and String parsing methods for getting a value from a cookie.
Then adding in Lawnchair's cookie parser, for fun.
Preparation code
<script>
var set = 'Cookie',
cookie = 'cookie1=cookie%20val%201; theCookie=value2; anotherCookie=value3; Cookie=value4; finally=;last=123'
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
String |
|
pending… |
RegExp (exec) |
|
pending… |
Lawnchair |
|
pending… |
RegExp (match) |
|
pending… |
Another Method |
|
pending… |
Another Method 2 |
|
pending… |
Compare results of other browsers
Revisions
You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:
- Revision 1: published by BrianMB
- Revision 3: published by BrianMB
- Revision 4: published by BrianMB
- Revision 5: published
- Revision 6: published
- Revision 7: published
- Revision 8: published
- Revision 9: published by taf2
- Revision 10: published
- Revision 11: published
- Revision 13: published
- Revision 14: published
0 comments