Skip to content

Performance

imshooter edited this page Nov 29, 2026 · 1 revision

Measured on one computer against MariaDB 10.4 on the same machine, open.mp 1.6.7 with PawnJIT, scripts compiled with -d2, medians of five runs.

Work Time
Sending a query, on the game thread 0.8 µs
500 queries in order, until the last public 45 ms
500 parallel queries, until the last public 16 ms
A formatted query into an array 0.64 µs
Six cells of a row by name 0.6 µs
Six cells of a row by index 0.3 µs
Six cells of a row with cache_get_row 0.2 µs
A query waited for 64 µs
2000 rows of a batch 15 ms
5000 inserts in order, in one transaction 310 ms
5000 parallel inserts with POOL_SIZE 16 856 ms
An Argon2id hash, 19 MiB and two passes 25 ms
Eight Argon2id hashes at once 55 ms

What costs what

  • The game thread only formats a query and hands it to a connection. The rows are copied out of the client library on the thread of the connection, so a large result costs the game thread nothing until it is read.
  • Writes in order wait for the server to write each one to disk. Many of them run fastest in a transaction or a batch.
  • Parallel writes gain from more connections in the pool, up to what the disk and the server take. Each connection is a thread of the plugin and a connection of the server, so the pool stays small by default.

Home

Guides

Reference

Functions

Connections
Queries
Cache
JSON cells
ORM
Queries built in pieces
Prepared statements
Batches
Transactions
Passwords
Callbacks

Clone this wiki locally