Skip to content

Commit bc90962

Browse files
committed
add todo
1 parent 2fde94b commit bc90962

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/rust/jsg-macros/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ pub fn jsg_struct(attr: TokenStream, item: TokenStream) -> TokenStream {
5858
fn wrap<'a, 'b>(this: Self::This, lock: &'a mut jsg::Lock) -> jsg::v8::Local<'b, jsg::v8::Value>
5959
where 'b: 'a,
6060
{
61+
// TODO(soon): Use a precached ObjectTemplate instance to create the object,
62+
// similar to how C++ JSG optimizes object creation. This would avoid recreating
63+
// the object shape on every wrap() call and improve performance.
6164
unsafe {
6265
let mut obj = lock.new_object();
6366
#(#field_assignments)*

0 commit comments

Comments
 (0)