Skip to content

Use builtin.null_list in both list and dict is_empty#128

Open
Micrograx wants to merge 1 commit intoaiken-lang:mainfrom
Micrograx:fix/use_null_list_builtin
Open

Use builtin.null_list in both list and dict is_empty#128
Micrograx wants to merge 1 commit intoaiken-lang:mainfrom
Micrograx:fix/use_null_list_builtin

Conversation

@Micrograx
Copy link
Copy Markdown
Contributor

Small optimization for list and dict is_empty, after noticing this behavior in tests:

const l = []

// [mem:   1.13 K, cpu: 293.09 K]
test bench_is_empty() {
  list.is_empty(l)
}

// [mem:    532.0, cpu: 138.53 K]
test bench_builtin() {
  builtin.null_list(l)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant