V_escape, the simd optimized escape code


#1

Crate v_escape provides two macros, new_escape! and new_escape_sized! , that define a struct with escaping functionalities. These macros are optimized using simd by default, but this can be alter using sub-attributes.

Example

#[macro_use]
extern crate v_escape;

new_escape_sized!(
     MyEscape,
     "62->b || 60->f || A->b || 65->f || 0o67->b || #6->f || 68->b || \
     71->f || 72->b || 73->f || 74->b || 75->f || 76->b || 77->f || \
     78->b",
);

assert_eq!(MyEscape::from("foo>bar<").to_string(), "foobbarf");

#2

Are there some benchmarks? Curious about the difference with https://github.com/djc/askama/tree/master/askama_escape for example


#3

Benchmark comparation between askama_escape, rocket and v_htmlescape, made with v_escape.