Skip to content

Conversation

@febo
Copy link
Contributor

@febo febo commented Apr 23, 2023

This PR optimizes the compute units usage on the unified create instruction.

Copy link
Contributor

@blockiosaurus blockiosaurus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! Good work!

invoke_signed(
&system_instruction::assign(new_account_info.key, &program_id),
accounts,
&system_instruction::create_account(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

BorshSerialize::serialize(&self, &mut bytes)?;

let data = &mut account.data.borrow_mut();
data[..bytes.len()].copy_from_slice(&bytes);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like we talked about this before, but is this better or worse than sol_memcpy?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants