Skip to content

Instantly share code, notes, and snippets.

@fersilva16
Last active February 5, 2022 16:25
Show Gist options
  • Save fersilva16/b34cc997e952d8c4d4573b5e30e24927 to your computer and use it in GitHub Desktop.
Save fersilva16/b34cc997e952d8c4d4573b5e30e24927 to your computer and use it in GitHub Desktop.
Benchmark of Metaplex's Metadata's findByOwner method
const web3 = require('@solana/web3.js');
const { Metadata } = require('./token-metadata/js/dist/src/mpl-token-metadata');
const connection = new web3.Connection(web3.clusterApiUrl('devnet'), 'confirmed');
const wallet = new web3.PublicKey('WALLET_PUBLIC_KEY');
console.time('findByOwnerV2');
Metadata.findByOwnerV2(connection, wallet).then(() => console.timeEnd('findByOwnerV2'));
console.time('findByOwnerV3');
Metadata.findByOwnerV3(connection, wallet).then(() => console.timeEnd('findByOwnerV3'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment