FAForever / FAForever/lua-lang

Pre-allocation syntax of tables

Aberta
#7 0 comentários 2 reações 0 responsáveis Ver no GitHub
Linguagem predominante
C
Estrelas
1
Forks
2
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

The Lua of the game supports pre-allocation syntax when you create a new table: `{&1&1}` where `1` can be any number. The numbers allow us to define the second and third argument of the `NEWTABLE` operation. For more information:
- https://www.lua.org/source/5.1/lopcodes.h.html

Previously no file with that syntax was part of the repository. But the `lazyvar.lua` file uses it: https://github.com/FAForever/fa/pull/3725 . It is also an interesting approach to get a 20% - 50% speed up on table allocations, according to benchmarks.

This compiler doesn't need to support the functionality. But it would be great if it would accept the syntax 😄 .

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.