Skip to content

Commit ec7e061

Browse files
committed
Cleaned up the code and removed tracing
1 parent c626f38 commit ec7e061

File tree

7 files changed

+2
-325
lines changed

7 files changed

+2
-325
lines changed

Cargo.toml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ too_many_arguments = 'allow'
1414
anyhow = { version = "1.0.95", default-features = false }
1515
heck = { version = "0.5", default-features = false }
1616
js-component-bindgen = { version = "1.11.0" }
17-
#orca-wasm = { version = "0.9.2", default-features = false }
18-
# wirm = { path = "../wirm/", features = ["parallel"] }
1917
wirm = { version = "2.1.0", features = ["parallel"] }
2018
rand = { version = "0.8", default-features = false }
2119
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
@@ -29,15 +27,6 @@ wasmparser = { version = "0.239.0", features = ["features",
2927
"validate",
3028
] }
3129

32-
# wasm-encoder = { path = "../wasm-tools/crates/wasm-encoder/", features = [ "component-model", "std" ] }
33-
# wasmparser = { path = "../wasm-tools/crates/wasmparser/", features = ["features",
34-
# "component-model",
35-
# "hash-collections",
36-
# "serde",
37-
# "simd" ,
38-
# "std",
39-
# "validate",
40-
# ] }
4130
wit-bindgen = { version = "0.41.0", features = [ "macros", "async", "realloc" ] }
4231
wit-bindgen-core = { version = "0.41.0", default-features = false }
4332
wit-component = { version = "0.227.1", features = ["dummy-module"] }

crates/spidermonkey-embedding-splicer/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ anyhow = { workspace = true }
1616
clap = { version = "4.5.31", features = ["suggestions", "color", "derive"] }
1717
heck = { workspace = true }
1818
js-component-bindgen = { workspace = true, features = [ "transpile-bindgen" ] }
19-
#orca-wasm = { workspace = true }
2019
wirm = { workspace = true }
2120
rand = { workspace = true }
2221
serde_json = { workspace = true }

crates/spidermonkey-embedding-splicer/src/bindgen.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use std::collections::{BTreeMap, BTreeSet, HashMap};
22
use std::fmt::Write;
33

44
use anyhow::Result;
5-
use std::time::Instant;
65
use heck::*;
76
use js_component_bindgen::function_bindgen::{
87
ErrHandling, FunctionBindgen, ResourceData, ResourceMap, ResourceTable,
@@ -142,8 +141,6 @@ pub fn componentize_bindgen(
142141
wid: WorldId,
143142
features: &Vec<Feature>,
144143
) -> Result<Componentization> {
145-
let t_total = Instant::now();
146-
let mut t_stage = Instant::now();
147144
let mut bindgen = JsBindgen {
148145
src: Source::default(),
149146
esm_bindgen: EsmBindgen::default(),
@@ -167,19 +164,9 @@ pub fn componentize_bindgen(
167164
.local_names
168165
.exclude_globals(Intrinsic::get_global_names());
169166

170-
t_stage = Instant::now();
171167
bindgen.imports_bindgen();
172-
eprintln!(
173-
"trace(bindgen:imports): {} ms",
174-
t_stage.elapsed().as_millis()
175-
);
176168

177-
t_stage = Instant::now();
178169
bindgen.exports_bindgen()?;
179-
eprintln!(
180-
"trace(bindgen:exports): {} ms",
181-
t_stage.elapsed().as_millis()
182-
);
183170
bindgen.esm_bindgen.populate_export_aliases();
184171

185172
// consolidate import specifiers and generate wrappers
@@ -387,32 +374,18 @@ pub fn componentize_bindgen(
387374
.concat(),
388375
);
389376

390-
t_stage = Instant::now();
391377
let js_intrinsics = render_intrinsics(&mut bindgen.all_intrinsics, false, true);
392378
output.push_str(&js_intrinsics);
393379
output.push_str(&bindgen.src);
394-
eprintln!(
395-
"trace(bindgen:intrinsics+emit): {} ms",
396-
t_stage.elapsed().as_millis()
397-
);
398380

399381
import_wrappers
400382
.iter()
401383
.for_each(|(_, src)| output.push_str(&format!("\n\n{src}")));
402384

403-
t_stage = Instant::now();
404385
bindgen
405386
.esm_bindgen
406387
.render_export_imports(&mut output, "$source_mod", &mut bindgen.local_names);
407-
eprintln!(
408-
"trace(bindgen:render-exports-imports): {} ms",
409-
t_stage.elapsed().as_millis()
410-
);
411388

412-
eprintln!(
413-
"trace(bindgen:total): {} ms",
414-
t_total.elapsed().as_millis()
415-
);
416389
Ok(Componentization {
417390
js_bindings: output.to_string(),
418391
exports: bindgen.exports,

0 commit comments

Comments
 (0)