-
-
Notifications
You must be signed in to change notification settings - Fork 221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add specialization #167
Add specialization #167
Conversation
At stable, the average escape time has been improved, remove the false positives, ascii 34 to 62, by means of a static table, it does not use simd. At nightly, simd has been integrated along with specialization, reduction of false positives to 1/64, full coverage and optimizations. |
So that's a big improvement on nightly, but it looks like the improvement comes largely from specialization (more so than from the SIMD implementations). I'm still unconvinced about the benefits of SIMD by itself, and also not sure about the complexity here. Here's some alternative thinking: what if we can make turn |
I agree, the best improvement in this e2e is offered by the specialization. The complexity is high but the performance is 10% below memchr3. It also has a relative coverage of 100% and only works at nightly. In stable it works by static table with what gives better performance for 2 or more false positives than the previous one. What do you propose for SIMD? for the results of other implementations, it will not have much better performance. We leave it or what else can I do? As for the trait, we can be done but we can only implement it on primitive types (usize, i8, str, String, ..), so it will stop working in other structures that imp Display. That or I do not just understand you. As for the #108 and #136, I do not understand it very well, I had thought about the specialization for these. You can explain a little more about this solution for the this issues. |
I enclose the benchmarks with throughput , they are the same data that rust-memchr |
The main implementation of SIMD, avx, loses performance below 11 bytes. I propose an operator for expressions, such as the As for the issue #136 , I can write a static table at compile time from askama.toml with the scalar implementation. With simd it is more complicated, but it can also be done simply by calculating the 3 minimum ranges, later like the previous one. SIMD uses only at nightly. |
I'm sorry -- I don't have the energy right now to dig into this, and I sometimes find it hard to understand what exactly you mean; there's a bit of a language barrier still. By the implementation of #136/#108 I mean that I think it would be useful to parametrize [escape]
html = "v_escape::HtmlEscaper" If nothing is configured, it would default to the |
I know, damn English, I need linguistic immersion. What I'm trying to say: let's merge the specialization and then we fix this issues. |
Nightly