remove servo code from wasm rewriter

This commit is contained in:
Toshit Chawda 2024-12-13 23:02:27 -08:00
parent 6c437d528f
commit 509b10337a
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
12 changed files with 39 additions and 51 deletions

View file

@ -1,22 +1,21 @@
use std::str::FromStr;
use criterion::{criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion};
use rewriter::{cfg::Config, rewrite};
use std::str::FromStr;
use url::Url;
use urlencoding::encode;
fn encode_string(str: String) -> String {
encode(&str).to_string()
}
pub fn bench(c: &mut Criterion) {
let discord = include_str!("../sample/discord.js");
let google = include_str!("../sample/google.js");
let url = Url::from_str("https://google.com/glorngle/si.js").expect("failed to make url");
let cfg = Config {
prefix: "/scrammedjet/".to_string(),
encoder: Box::new(encode_string),
base: Url::from_str("https://google.com/glorngle/si.js").expect("invalid base"),
base: url.to_string(),
urlrewriter: Box::new(move |x: String| encode(url.join(&x).unwrap().as_str()).to_string()),
sourcetag: "glongle1".to_string(),
wrapfn: "$wrap".to_string(),