energy

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Table = [256]Cost{

	opcode.PUSH:  1,
	opcode.POP:   1,
	opcode.LOAD:  2,
	opcode.STORE: 2,
	opcode.GET:   12,
	opcode.DUP:   1,

	opcode.ADD: 2,
	opcode.SUB: 2,
	opcode.MUL: 6,
	opcode.DIV: 25,

	opcode.AND: 1,
	opcode.OR:  1,
	opcode.NOT: 1,

	opcode.COMPARE: 4,
	opcode.JUMP:    3,
	opcode.TRUE:    3,
	opcode.FALSE:   3,
	opcode.ITER:    15,
	opcode.HALT:    0,
	opcode.YIELD:   0,

	opcode.MAKE: 80,
	opcode.SET:  10,

	opcode.CALL:   150,
	opcode.INVOKE: 150,
	opcode.LAMBDA: 60,
	opcode.RETURN: 5,
	opcode.DEFER:  10,
	opcode.SPAWN:  200,
}

Table là bản đồ chi phí năng lượng được chuẩn soát dựa trên CPU Cycles và Memory Latency. Thiết kế mảng 256 phần tử đảm bảo tra cứu O(1) và tối ưu L1 Instruction Cache.

Functions

This section is empty.

Types

type Cost

type Cost uint64

Cost đại diện cho đơn vị năng lượng tiêu thụ thực tế trên hạ tầng.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL