Performance considerations#
Woke testing framework is designed to be fast and efficient. However, there are some things to keep in mind to achieve the best performance.
- Always prefer to use Anvil whenever possible.
- Avoid accessing transaction events (
tx.events
) unless necessary. Consider usingtx.raw_events
instead. - Avoid using accounts other than the pre-generated ones (
chain.accounts
) infrom_
parameters. If you need more accounts than the default number, change the Woke configuration file or launch the development chain with a higher number of accounts and connect to it. - Minimize usage of call traces (
tx.call_trace
) and console logs (tx.console_logs
). These features are useful for debugging, but may slow down the test execution.
Profiling tests#
Every Woke command has a --profile
flag that can be used to profile the test execution. The profiling results are saved into the woke.prof
file.
Warning
It is important to specify the --profile
flag before the test
command.
It is not recommended to profile the woke fuzz
command because it uses multiprocessing.
Woke uses cProfile dump_stats method to save the profiling results.