| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - /* auto-generated on 2023-09-29 13:28:16 -0400. Do not edit! */ | ||
| 1 | + /* auto-generated on 2023-09-30 20:34:30 -0400. Do not edit! */ | ||
| 2 | 2 | /* begin file src/ada.cpp */ | |
| 3 | 3 | #include "ada.h" | |
| 4 | 4 | /* begin file src/checkers.cpp */ | |
@@ -9810,6 +9810,17 @@ constexpr bool to_lower_ascii(char* input, size_t length) noexcept { | |||
| 9810 | 9810 | #if ADA_NEON | |
| 9811 | 9811 | ada_really_inline bool has_tabs_or_newline( | |
| 9812 | 9812 | std::string_view user_input) noexcept { | |
| 9813 | + // first check for short strings in which case we do it naively. | ||
| 9814 | + if (user_input.size() < 16) { // slow path | ||
| 9815 | + for (size_t i = 0; i < user_input.size(); i++) { | ||
| 9816 | + if (user_input[i] == '\r' || user_input[i] == '\n' || | ||
| 9817 | + user_input[i] == '\t') { | ||
| 9818 | + return true; | ||
| 9819 | + } | ||
| 9820 | + } | ||
| 9821 | + return false; | ||
| 9822 | + } | ||
| 9823 | + // fast path for long strings (expected to be common) | ||
| 9813 | 9824 | size_t i = 0; | |
| 9814 | 9825 | const uint8x16_t mask1 = vmovq_n_u8('\r'); | |
| 9815 | 9826 | const uint8x16_t mask2 = vmovq_n_u8('\n'); | |
@@ -9822,9 +9833,8 @@ ada_really_inline bool has_tabs_or_newline( | |||
| 9822 | 9833 | vceqq_u8(word, mask3)); | |
| 9823 | 9834 | } | |
| 9824 | 9835 | if (i < user_input.size()) { | |
| 9825 | - uint8_t buffer[16]{}; | ||
| 9826 | - memcpy(buffer, user_input.data() + i, user_input.size() - i); | ||
| 9827 | - uint8x16_t word = vld1q_u8((const uint8_t*)user_input.data() + i); | ||
| 9836 | + uint8x16_t word = | ||
| 9837 | + vld1q_u8((const uint8_t*)user_input.data() + user_input.length() - 16); | ||
| 9828 | 9838 | running = vorrq_u8(vorrq_u8(running, vorrq_u8(vceqq_u8(word, mask1), | |
| 9829 | 9839 | vceqq_u8(word, mask2))), | |
| 9830 | 9840 | vceqq_u8(word, mask3)); | |
@@ -9834,6 +9844,17 @@ ada_really_inline bool has_tabs_or_newline( | |||
| 9834 | 9844 | #elif ADA_SSE2 | |
| 9835 | 9845 | ada_really_inline bool has_tabs_or_newline( | |
| 9836 | 9846 | std::string_view user_input) noexcept { | |
| 9847 | + // first check for short strings in which case we do it naively. | ||
| 9848 | + if (user_input.size() < 16) { // slow path | ||
| 9849 | + for (size_t i = 0; i < user_input.size(); i++) { | ||
| 9850 | + if (user_input[i] == '\r' || user_input[i] == '\n' || | ||
| 9851 | + user_input[i] == '\t') { | ||
| 9852 | + return true; | ||
| 9853 | + } | ||
| 9854 | + } | ||
| 9855 | + return false; | ||
| 9856 | + } | ||
| 9857 | + // fast path for long strings (expected to be common) | ||
| 9837 | 9858 | size_t i = 0; | |
| 9838 | 9859 | const __m128i mask1 = _mm_set1_epi8('\r'); | |
| 9839 | 9860 | const __m128i mask2 = _mm_set1_epi8('\n'); | |
@@ -9847,9 +9868,8 @@ ada_really_inline bool has_tabs_or_newline( | |||
| 9847 | 9868 | _mm_cmpeq_epi8(word, mask3)); | |
| 9848 | 9869 | } | |
| 9849 | 9870 | if (i < user_input.size()) { | |
| 9850 | - alignas(16) uint8_t buffer[16]{}; | ||
| 9851 | - memcpy(buffer, user_input.data() + i, user_input.size() - i); | ||
| 9852 | - __m128i word = _mm_load_si128((const __m128i*)buffer); | ||
| 9871 | + __m128i word = _mm_loadu_si128( | ||
| 9872 | + (const __m128i*)(user_input.data() + user_input.length() - 16)); | ||
| 9853 | 9873 | running = _mm_or_si128( | |
| 9854 | 9874 | _mm_or_si128(running, _mm_or_si128(_mm_cmpeq_epi8(word, mask1), | |
| 9855 | 9875 | _mm_cmpeq_epi8(word, mask2))), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - /* auto-generated on 2023-09-29 13:28:16 -0400. Do not edit! */ | ||
| 1 | + /* auto-generated on 2023-09-30 20:34:30 -0400. Do not edit! */ | ||
| 2 | 2 | /* begin file include/ada.h */ | |
| 3 | 3 | /** | |
| 4 | 4 | * @file ada.h | |
@@ -6928,14 +6928,14 @@ inline void url_search_params::sort() { | |||
| 6928 | 6928 | #ifndef ADA_ADA_VERSION_H | |
| 6929 | 6929 | #define ADA_ADA_VERSION_H | |
| 6930 | 6930 | ||
| 6931 | - #define ADA_VERSION "2.6.9" | ||
| 6931 | + #define ADA_VERSION "2.6.10" | ||
| 6932 | 6932 | ||
| 6933 | 6933 | namespace ada { | |
| 6934 | 6934 | ||
| 6935 | 6935 | enum { | |
| 6936 | 6936 | ADA_VERSION_MAJOR = 2, | |
| 6937 | 6937 | ADA_VERSION_MINOR = 6, | |
| 6938 | - ADA_VERSION_REVISION = 9, | ||
| 6938 | + ADA_VERSION_REVISION = 10, | ||
| 6939 | 6939 | }; | |
| 6940 | 6940 | ||
| 6941 | 6941 | } // namespace ada | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ All dependencies are located within the `deps` directory. | |||
| 9 | 9 | This a list of all the dependencies: | |
| 10 | 10 | ||
| 11 | 11 | * [acorn][] | |
| 12 | - * [ada 2.6.9][] | ||
| 12 | + * [ada 2.6.10][] | ||
| 13 | 13 | * [base64][] | |
| 14 | 14 | * [brotli][] | |
| 15 | 15 | * [c-ares][] | |
@@ -148,7 +148,7 @@ The [acorn](https://github.com/acornjs/acorn) dependency is a JavaScript parser. | |||
| 148 | 148 | [acorn-walk](https://github.com/acornjs/acorn/tree/master/acorn-walk) is | |
| 149 | 149 | an abstract syntax tree walker for the ESTree format. | |
| 150 | 150 | ||
| 151 | - ### ada 2.6.9 | ||
| 151 | + ### ada 2.6.10 | ||
| 152 | 152 | ||
| 153 | 153 | The [ada](https://github.com/ada-url/ada) dependency is a | |
| 154 | 154 | fast and spec-compliant URL parser written in C++. | |
@@ -312,7 +312,7 @@ it comes from the Chromium team's zlib fork which incorporated | |||
| 312 | 312 | performance improvements not currently available in standard zlib. | |
| 313 | 313 | ||
| 314 | 314 | [acorn]: #acorn | |
| 315 | - [ada 2.6.9]: #ada-269 | ||
| 315 | + [ada 2.6.10]: #ada-2610 | ||
| 316 | 316 | [base64]: #base64 | |
| 317 | 317 | [brotli]: #brotli | |
| 318 | 318 | [c-ares]: #c-ares | |
| Back | FazBrowse Home | New Git URL |
0 commit comments