Commit Graph

55 Commits

Author SHA1 Message Date
ZhangYunHao b1ca43febc Use 'go generate' in bytesconv.go (#663)
* Add bytesconv_table_gen.go
2019-09-28 14:55:31 +02:00
ZYunH be93fbd21b Add lowerhex 2019-09-20 06:33:34 +03:00
ZYunH 79bd450e0e Use 0xf instead of 15 2019-09-20 06:33:34 +03:00
ZYunH 91138eed5f Replace int2hexbyte with uppercase 2019-09-20 06:33:34 +03:00
ZYunH 9bc19f85e1 Replace hexCharUpeer with upperhex (#657) 2019-09-19 13:15:51 +02:00
ZYunH ae421163c5 Improve appendQuotedPath and AppendQuotedArg (#654)
* Update bytesconv.go
* Modify tests
* Remove unnecessary comments
* Update args_test.go
* Add test for appendQuotedPath
* Fix 11202 issue
* Fix some problems
2019-09-18 13:52:04 +02:00
ZYunH c5413ffda8 A faster s2b function (#637)
* Use pointer for smaller stack space
2019-08-19 10:45:03 +02:00
Erik Dubbelboer 6453619524 Remove methods that had been deprecated in 2015 2019-02-16 15:10:39 +01:00
Erik Dubbelboer 8a9bdc8177 Fix ParseUint to support all possible numbers
Fixes #461
2018-11-14 01:59:18 +08:00
Iskander Sharipov 5c41b44ca7 use proper "Deprecated" comment format
Found using https://go-critic.github.io/overview#deprecatedComment-ref
2018-09-11 22:29:16 +03:00
Erik Dubbelboer 50bdd6c77c Fix appendQuotedPath to include all allowed characters 2018-09-05 20:06:18 +03:00
Jan Siemiński 6231e237de Add ';' to unescaped characters 2018-09-01 13:00:11 +08:00
Kirill Danshin 4a16377d6e Merge pull request #303 from chebyrash/master
Typo fixes
2018-08-13 23:18:55 +03:00
Aliaksandr Valialkin e5f51c1191 added missing byte 0xFF into hex2intTable. This fixes panic when decoding specially crafted string like "%\xff" 2017-12-07 14:09:41 +02:00
xPushkin f24d00fcc6 A lot of typo fixes 2017-10-08 13:30:35 +01:00
Aliaksandr Valialkin d257ae60a3 ioptimized decodeArgAppend a bit
Benchmark results on linux/amd64:

name                           old time/op  new time/op  delta
ArgsParse-4                    72.8ns ± 2%  68.0ns ± 2%  -6.59%  (p=0.000 n=10+9)
AppendUnquotedArgFastPath-4    20.4ns ± 2%  21.1ns ± 9%    ~     (p=0.614 n=8+10)
AppendUnquotedArgSlowPath-4    68.9ns ± 3%  70.4ns ± 6%    ~     (p=0.148 n=9+10)
URIParsePath-4                 80.9ns ± 2%  78.7ns ± 2%  -2.80%  (p=0.000 n=10+10)
URIParsePathQueryString-4      88.9ns ± 1%  86.3ns ± 1%  -2.90%  (p=0.000 n=10+8)
URIParsePathQueryStringHash-4  95.7ns ± 8%  91.0ns ± 1%  -4.88%  (p=0.000 n=9+10)
URIParseHostname-4             98.6ns ± 1%  95.4ns ± 1%  -3.24%  (p=0.000 n=10+10)
2017-07-21 16:08:21 +03:00
Aliaksandr Valialkin 52a0993b96 Issue #278: more optimizations for normalizeHeaderKey 2017-07-11 10:17:57 +03:00
Aliaksandr Valialkin 952171f61b Issue #278: optimize normalizeHeaderKey a bit
Performance results on amd64:

name                            old time/op  new time/op  delta
NormalizeHeaderKeyCommonCase-4  43.3ns ± 0%  32.6ns ± 1%  -24.80%  (p=0.000 n=9+10)
NormalizeHeaderKeyLowercase-4   42.6ns ± 3%  32.6ns ± 1%  -23.41%  (p=0.000 n=10+10)
NormalizeHeaderKeyUppercase-4   43.5ns ± 1%  32.6ns ± 2%  -25.03%  (p=0.000 n=9+8)

Based on top of https://github.com/valyala/fasthttp/pull/279 .
2017-07-10 14:28:06 +03:00
Aliaksandr Valialkin 0f5182f9ce added a fast path to AppendHTMLEscape when the string doesnt contain special chars 2017-06-23 19:04:29 +03:00
Aliaksandr Valialkin c0de95e84b Added AppendUnquotedArg - the complementary function to AppendQuotedArg 2017-06-19 18:35:07 +03:00
Aliaksandr Valialkin 033bb40f06 Properly handle hashes and single dots in URI.Update (see https://github.com/kataras/iris/issues/173) 2016-06-07 13:30:03 +03:00
Aliaksandr Valialkin 0f76772285 Do no allocate memory for error when an empty string is passed to ParseIPv4() 2016-04-28 13:07:09 +03:00
Aliaksandr Valialkin 9946a8145e bytesconv: reduce memory allocations on parse errors by using static errors 2016-03-30 20:49:09 +03:00
Aliaksandr Valialkin 0d43464f64 Renamed unsafeBytes2Str to b2s 2016-03-29 16:26:21 +03:00
Aliaksandr Valialkin 394c20fdc5 Added AppendHTMLEscape helper function 2016-02-15 16:53:44 +02:00
Aliaksandr Valialkin 52ddf98cfd Fixed golint warnings 2016-01-19 12:43:23 +02:00
Aliaksandr Valialkin 485098e5dc Exported AppendQuotedArg 2016-01-13 18:17:03 +02:00
Aliaksandr Valialkin 37ad7e0e32 typo fix 2016-01-13 18:03:02 +02:00
Aliaksandr Valialkin 4bca54c0bb Issue #29: use time.UTC instead of time.LoadLocation, since this call may fail on systems without certain config files 2016-01-04 15:55:30 +02:00
Aliaksandr Valialkin eb18481efb Escape query args chars according to http://www.w3.org/TR/html5/forms.html#form-submission-algorithm 2015-12-23 19:26:48 +02:00
Aliaksandr Valialkin e4ed4ab3c0 Moved appendQuotedPath to bytesconv 2015-12-23 11:22:14 +02:00
Aliaksandr Valialkin ea8a7f54d5 Do not escape '-' and '_' in url path and query args 2015-12-22 20:18:19 +02:00
Aliaksandr Valialkin b3c0a2cf75 Do not escape the most frequently used chars in uri path such as ':~=,' 2015-12-22 20:13:45 +02:00
Aliaksandr Valialkin 052a3cfb65 Substitute EqualBytesStr(s, b) by string(b) == s 2015-12-19 20:44:01 +02:00
Aliaksandr Valialkin 5ff6be8fee Substitute AppendBytesStr by append() 2015-12-19 20:38:10 +02:00
Aliaksandr Valialkin ddfa9f5dc0 Clarify Append* return values 2015-12-19 20:29:17 +02:00
Aliaksandr Valialkin 3222ab8c8c Added AppendIPv4 and ParseIPv4 helper functions 2015-12-11 13:11:15 +02:00
Aliaksandr Valialkin 9c18f79145 Added support for If-Modified-Since to SendFile and FS 2015-12-09 18:51:51 +02:00
Aliaksandr Valialkin 48192ad44c Integrated AppendUint perfromance optimization from pull request #2. Thanks to @EricLagergren 2015-12-02 15:01:13 +02:00
Aliaksandr Valialkin dd6422c56f Optimized hexbyte2int 2015-11-30 19:57:59 +02:00
Aliaksandr Valialkin 66d1cfd6e3 bytesconv code prettifying 2015-11-30 19:42:21 +02:00
Aliaksandr Valialkin 3e3d68aed2 Code cleanup: removed redundant unhex 2015-11-30 19:33:32 +02:00
Aliaksandr Valialkin c04fdb47a5 Test writeHexInt for 32-bit and 64-bit architectures 2015-11-28 23:11:07 +02:00
Aliaksandr Valialkin 974a1c99ce Optimized AppendUint by using stack-based buffer instead of uintBufPool 2015-11-28 23:00:10 +02:00
Aliaksandr Valialkin 54b3bf6b21 fixed spelling typo 2015-11-28 21:48:58 +02:00
Aliaksandr Valialkin 58d404c7e9 Issue #7: an attempt to blindly fix arm build according to @msoap suggestion 2015-11-28 20:47:17 +02:00
Aliaksandr Valialkin 4aac41a918 Use the most optimized AppendBytesStr() implementation - append(dst, src..) :) 2015-11-26 20:10:51 +02:00
Aliaksandr Valialkin 2d41d2b734 Optimized AppendBytesStr - now it is 2x faster 2015-11-24 13:22:34 +02:00
Aliaksandr Valialkin 961eef082b Optimized EqualBytesStr 2015-11-24 12:57:01 +02:00
Aliaksandr Valialkin 3cc7fe9675 Moved byte slice manipulation functions to bytesconv.go 2015-11-22 13:45:42 +02:00