Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate the effect of using memcpy/memmove from custom Solana SDK #183

Closed
s-medvedev opened this issue May 13, 2021 · 1 comment
Closed
Assignees

Comments

@s-medvedev
Copy link

s-medvedev commented May 13, 2021

To carry out measurements, we need to use a Solana node with support for memory system calls and build a contract with a custom toolchain.

Memory operations syscall can be found in solana-labs/solana#16447

Custom toolchain supported the memory operations:

  1. https://github.com/dmakarov/bpf-tools/actions/runs/748017344 - first version.
  2. https://github.com/dmakarov/bpf-tools/actions/runs/755303744 - second version. This version doesn't generate a call to sol_mem* syscalls unless the number of store or load instructions is greater than 8 for the operation. It may be more efficient to perform mem-ops on small amounts of data in the VM than to make a syscall for every mem-op. It would be interesting to see your results comparing both versions of the toolchain.

Expected result:
Here is what jackmay expect:

  • original toolchain should work fine but will do all the mem ops via BPF instructions within the VM
  • old toolchain, should error if you program called memcmp due to bug in the toolchain
  • new toolchain, should work fine, mem ops will be performed by native instructions via a syscall.
@s-medvedev s-medvedev self-assigned this May 21, 2021
@s-medvedev
Copy link
Author

Base Syscalls-1 Syscalls-2    
8830 7849 11% 8857 0%
9246 8199 11% 9268 0%
6293523 6230410 1% 6234533 1%
224226 95898 57% 102172 54%
9246 8199 11% 9268 0%
6074352 6054892 0% 6059066 0%
279963 236590 15% 248772 11%
9246 8199 11% 9268 0%
6018818 5999342 0% 6003465 0%
279411 236183 15% 248226 11%
9246 8199 11% 9268 0%
341660 289435 15% 294316 14%
1242029 1002169 19% 1031531 17%
107548 92136 14% 96298 10%
246454 222255 10% 233165 5%
107591 92179 14% 96341 10%
246666 222378 10% 233374 5%
300680 254991 15% 261689 13%
1743233 1602006 8% 1647768 5%
827038 748724 9% 783558 5%
107548 92136 14% 96298 10%
247376 223088 10% 234081 5%
296910 251969 15% 257596 13%
1467123 1349944 8% 1400329 5%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant