Skip to content

Commit 6da8e08

Browse files
committed
update
1 parent 10ba891 commit 6da8e08

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,11 @@ node_modules
1515
yarn-error.log
1616
.vscode/settings.json
1717

18+
# Profiling
19+
*.string_data
20+
*.string_index
21+
*.events
22+
chrome_profiler.json
23+
1824
# tests/js/test.js is used for testing changes locally
1925
tests/js/test.js

boa/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ pub fn forward(engine: &mut Interpreter, src: &str) -> String {
8282
pub fn forward_val(engine: &mut Interpreter, src: &str) -> ResultValue {
8383
// Setup executor
8484
let profiler = MyProfiler::new();
85-
profiler.start_event("Parser");
86-
let res = parser_expr(src).unwrap();
85+
let _timer = profiler.start_event("Main");
8786

8887
match parser_expr(src) {
8988
Ok(expr) => engine.run(&expr),

boa/src/profiler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ pub struct MyProfiler {
1717
impl MyProfiler {
1818
pub fn start_event(&self, label: &str) -> TimingGuard<'_, SerializationSink> {
1919
let kind = self.profiler.alloc_string("Generic");
20-
let lab = EventId::from_label(self.profiler.alloc_string(label));
20+
let id = EventId::from_label(self.profiler.alloc_string(label));
2121
let thread_id = std::thread::current().id().as_u64() as u32;
2222
self.profiler
23-
.start_recording_interval_event(kind, lab, thread_id)
23+
.start_recording_interval_event(kind, id, thread_id)
2424
}
2525

2626
pub fn new() -> MyProfiler {

0 commit comments

Comments
 (0)