Commit 805ebef
buffer: optimize decoding wrapped base64 data
The fast base64 decoder used to switch to the slow one permanently when
it saw a whitespace or other garbage character. Since the most common
situation such characters may be encountered in is line-wrapped base64
data, a more profitable strategy is to decode a single 24-bit group with
the slow decoder and then continue running the fast algorithm.
PR-URL: #12146
Ref: #12114
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>1 parent fb34d9c commit 805ebefCopy full SHA for 805ebef
File tree
Expand file treeCollapse file tree
2 files changed
+61
-34
lines changedOpen diff view settings
Filter options
- benchmark/buffers
- src
Expand file treeCollapse file tree
2 files changed
+61
-34
lines changedOpen diff view settings
Collapse file
benchmark/buffers/buffer-base64-decode-wrapped.js
Copy file name to clipboard+26Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
Collapse file
+35-34Lines changed: 35 additions & 34 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
52 | 52 | |
53 | 53 | |
54 | 54 | |
55 | | - |
56 | | - |
| 55 | + |
| 56 | + |
| 57 | + |
57 | 58 | |
58 | 59 | |
59 | | - |
60 | | - |
61 | | - |
62 | 60 | |
63 | | - |
64 | | - |
65 | | - |
66 | | - |
67 | | - |
68 | | - |
69 | | - |
70 | | - |
71 | | - |
72 | | - |
73 | | - |
74 | | - |
75 | | - |
76 | | - |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
82 | 80 | |
83 | | - |
84 | | - |
| 81 | + |
85 | 82 | |
86 | 83 | |
87 | 84 | |
| ||
90 | 87 | |
91 | 88 | |
92 | 89 | |
93 | | - |
94 | 90 | |
| 91 | + |
95 | 92 | |
96 | 93 | |
97 | 94 | |
| ||
102 | 99 | |
103 | 100 | |
104 | 101 | |
105 | | - |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
106 | 112 | |
107 | | - |
108 | | - |
109 | | - |
110 | | - |
111 | | - |
112 | 113 | |
113 | 114 | |
114 | | - |
| 115 | + |
115 | 116 | |
116 | 117 | |
117 | 118 | |
|
0 commit comments