Skip to content

Optimize VM #21

@bit-hack

Description

@bit-hack

The follow opcode frequencies were gathers from the 1k fuzz tests.
The VM should be optimized to prefer the more frequently called instructions.

Also we should look at common instruction pairs, and optimize for them.

  20 584890 INS_CONST
  21 240505 INS_LOCALS
  16 239147 INS_CALL
  26 153893 INS_GETG
  8  37696  INS_NOT
  15 30480  INS_CJMP
  22 24626  INS_GETV
  23 24321  INS_SETV
  14 5629   INS_JMP
  28 3962   INS_GETGI
  29 3524   INS_SETGI
  27 2882   INS_SETG
  0  2877   INS_ADD
  12 2581   INS_GEQ
  11 2418   INS_LEQ
  7  2265   INS_OR
  3  2179   INS_MUL
  9  2121   INS_LT
  2  1764   INS_SUB
  10 1734   INS_GT
  13 1581   INS_EQ
  17 1546   INS_RET
  4  1380   INS_DIV
  24 1283   INS_GETVI
  6  939    INS_AND
  25 826    INS_SETVI
  19 214    INS_POP
  1  0      INS_INC
  5  0      INS_MOD
  18 0      INS_SCALL

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions