/luau-kb:luau-perffrom luau-kb
Measured Luau performance: benchmark method, metatable, table, closure and string costs, -O2 and --!native effects, GC pressure. Use when Luau code is slow, optimization is asked, or a benchmark is written or read. Engine API cost is roblox-engine. 트리거: 코드가 느려, 최적화해 줘, 벤치마크.
Ships in luau-kb. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
이 스킬은 "이 Luau 코드는 왜 느린가, 무엇을 바꾸면 얼마나 빨라지나"를 다룬다. 수치는 기계마다 다르므로 배수(비율)로 적는다. 표의 열은 언제나 버전 모드 다(0.734 -O1 은 원천과 조건을 맞춘 대조 열).
luau --profile 이나 실제 호출 모양의 벤치로 찾는다. 어느 모드에서 재는지 정한다(CLI 기본 -O1, Roblox 라이브 -O2, 서버 native). → references/benchmarking-method.md §1–§3control 대조군, 프로세스 반복. 비교 대상 함수는 다른 모듈에 둔다(같은 파일이면 -O2 가 인라인한다). → bench/lib/bench.luau, benchmarking-method.md §2·§5control 이 1.00 에서 벗어난 만큼이 잡음이다. 모드 넷에서 방향이 같은지 본다. → benchmarking-method.md §4| 증상 / 질문 | 읽을 곳 |
|---|---|
메타테이블을 붙였더니 배열 인덱싱이 느리다, rawget·freeze 로 피할 수 있나 | references/metatables.md §2·§4 |
| 메타테이블 객체의 필드·안쪽 표 접근, 클래스 구조를 어떻게 짜나 | references/metatables.md §3·§6 |
| 메서드를 인스턴스에 복사하면, 생성·메모리 비용 | references/metatables.md §5 |
배열에 nil 구멍, 앞에서 빼는 큐, table.remove(t, 1), 음수 키 | references/tables.md §2·§3 |
| 레코드를 번호 칸으로 할까 이름 필드로 할까, 생성자 밖 대입 | references/tables.md §4 |
table.create, table.move, table.clone, # 비용, 키 종류별 조회 | references/tables.md §5–§7 |
ipairs 대 숫자 for 대 for k, v in t, 이터레이터 API 설계, next(t, k) | references/iteration.md |
obj:M() 대 Mod.M(obj), 함수 감싸기, 동적 dispatch | references/calls-and-closures.md §2 |
클로저 콜백·업밸류 비용, 가변 인자·select·table.pack, pcall, 코루틴, 인자 표 | references/calls-and-closures.md §3–§5 |
문자열 ..= 누적, 파서, 사용자 패턴의 역추적 | references/strings.md |
-O2·--!optimize, 인라인 조건, error(msg, 2) 위치가 -O2 에서 틀림 | references/optimizer-and-native.md §2–§4 (경우별 표는 luau-testing optimize-levels.md §2) |
t.Name 대 t[1], 다른 모듈 상수 키, :: 캐스트 비용 | references/optimizer-and-native.md §3·§5 |
--!native/@native 를 붙일까, 타입 주석이 native 에 주는 효과 | references/optimizer-and-native.md §6 |
약한 테이블 비용, __mode="ks", GC 시간, 객체 메모리 크기, 클로저 캐시 | references/gc-and-memory.md (ephemeron·weak 의미론은 luau-runtime gc-and-weak-tables.md) |
해시 대 정렬 병합, 힙 짓기, table.sort 비교자, 결과 표 대 다중 반환, 자료구조 선택 | references/algorithms-and-structures.md |
| Instance 생성·속성 대입·바인더블·트윈 비용, Studio 프로파일러, 라이브 최적화 수준 | roblox-engine 스킬 references/perf.md, luau-roblox 스킬 references/studio-mcp.md §6 |
t[i] 는 -O1 1.6 배, native 읽기 2.1 배·쓰기 4.4 배 느리다. 상수 문자열 필드와 안쪽 표는 영향 없다.{prev, nil, value = v} 처럼 생성자에 자리를 잡는다.-O2 는 같은 파일 지역 함수를 인라인해 공짜로 만든다. 같은 파일에 흉내 낸 함수로 벤치하면 결론이 틀어진다.-O2(그리고 --!native/@native)에서는 손으로 센 error(msg, level) 이 위치를 잃거나 틀린 줄을 가리킨다.s ..= x 누적은 O(n²) 다. 표에 모아 table.concat.__mode="k" 는 비워져도 칸 배열이 줄지 않는다("ks" 는 준다). 값이 키를 가리키면 영원히 안 비워진다(ephemeron 아님).bench/(실행 bench/run.sh, 표 bench/summarize.py, 결과 bench/RESULTS.md), 결정적인 주장은 snippets/perf-*.luau(--@run), 최적화 수준·native 는 snippets/opt-*.luau·snippets/native-*.luau(luau-testing·verify 담당)에 있다.references/provenance.md 에 있다.references/algorithms-and-structures.md (opens in a new tab)references/benchmarking-method.md (opens in a new tab)references/calls-and-closures.md (opens in a new tab)references/gc-and-memory.md (opens in a new tab)references/iteration.md (opens in a new tab)references/metatables.md (opens in a new tab)references/optimizer-and-native.md (opens in a new tab)references/provenance.md (opens in a new tab)references/strings.md (opens in a new tab)references/tables.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub qwreey/qwreey-harness --plugin luau-kb12 skills in this plugin
/luau-robloxRoblox typing and test setup: luau-lsp definition files and sourcemap, typing GetService, Instance.new, FindFirstChild and IsA, luau CLI mocks vs Studio, Studio MCP. Use when Roblox API types fail or deciding mock vs Studio. Engine behavior is roblox-engine/net/world. 트리거: mock 으로 충분해?, Studio MCP, 정의 파일 설정./luau-runtimeLuau semantics without the Roblox engine: weak tables and GC leaks, swallowed coroutine errors, require-by-string in the luau CLI (init.luau, @self, aliases). Use when weak entries persist, a coroutine error vanishes, or require cannot resolve. In-engine behavior is roblox-engine. 트리거: weak table 안 사라짐, 코루틴 에러 삼킴, require 안 풀림./luau-styleLuau style and idioms with rationale: naming, modules and file splitting, error handling, comments, stylua, and traps the checker misses (table.insert, nil varargs, patterns). Use when writing or reviewing .luau files. Type defects are luau-types; require is luau-runtime. 트리거: 네이밍 기준, 파일 분리, 스타일 리뷰.Other plugins' skills for the same job