On a production chain, you should always re-calculate your weights by running benchmarks on the final runtime. The point of benchmarking is that your runtime can be configured in different ways, and your blockchain may have different assumptions than others. So running benchmarks gives you real results for exactly how you developed your runtime.
The benchmarking tooling is enabled in Substrate based chains by compiling with the feature flag --features=runtime-benchmarks
.
And can be run like so:
./target/release/substrate benchmark \
--chain dev \ # Configurable Chain Spec
--execution=wasm \ # Always test with Wasm
--wasm-execution=compiled \ # Always used `wasm-time`
--pallet pallet_balances \ # Select the pallet
--extrinsic transfer \ # Select the extrinsic
--steps 50 \ # Number of samples across component ranges
--repeat 20 \ # Number of times we repeat a benchmark
--output <path> \ # Output benchmark results into a folder or file
More information about benchmarking can be found here: https://github.com/paritytech/substrate/tree/master/frame/benchmarking
And this video: https://www.youtube.com/watch?v=Qa6sTyUqgek