Skip to content

Commit

Permalink
perf: reduce startup time
Browse files Browse the repository at this point in the history
  • Loading branch information
lewis6991 committed Mar 1, 2023
1 parent 76b71f7 commit 60b4933
Show file tree
Hide file tree
Showing 33 changed files with 1,536 additions and 1,382 deletions.
23 changes: 6 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
branches: [ main ]
workflow_dispatch:

env:
CC: clang

jobs:
commit_lint:
runs-on: ubuntu-latest
Expand All @@ -30,14 +27,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install LuaJIT
uses: leafo/gh-actions-lua@v9
with:
luaVersion: "luajit-2.1.0-beta3"

- name: Install Luarocks
uses: leafo/gh-actions-luarocks@v4

- name: Get Neovim SHA
id: get-nvim-sha
run: |
Expand All @@ -50,12 +39,6 @@ jobs:
path: deps
key: ${{ steps.get-nvim-sha.outputs.sha }}-${{ hashFiles('.github/workflows/ci.yml, Makefile') }}

- name: Install Lua Deps
run: make lua_deps

- name: Check lua files are built from latest teal
run: make tl-ensure

- name: Install Neovim build dependencies
if: steps.cache-deps.outputs.cache-hit != 'true'
run: |
Expand All @@ -78,5 +61,11 @@ jobs:
if: steps.cache-deps.outputs.cache-hit != 'true'
run: make test_deps

- name: Install Lua Deps
run: make lua_deps

- name: Check lua files are built from latest teal
run: make tl-ensure

- name: Run Test
run: make test
15 changes: 7 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

export PJ_ROOT=$(PWD)

# Suppress built in rules. This reduces clutter when running with -d
MAKEFLAGS += --no-builtin-rules

FILTER ?= .*

LUA_VERSION := 5.1
Expand All @@ -13,7 +10,7 @@ NEOVIM_BRANCH ?= master
DEPS_DIR := $(PWD)/deps/nvim-$(NEOVIM_BRANCH)
NVIM_DIR := $(DEPS_DIR)/neovim

LUAROCKS := luarocks --lua-version=$(LUA_VERSION)
LUAROCKS := $(DEPS_DIR)/luarocks/usr/bin/luarocks
LUAROCKS_TREE := $(DEPS_DIR)/luarocks/usr
LUAROCKS_LPATH := $(LUAROCKS_TREE)/share/lua/$(LUA_VERSION)
LUAROCKS_INIT := eval $$($(LUAROCKS) --tree $(LUAROCKS_TREE) path) &&
Expand All @@ -23,25 +20,27 @@ LUAROCKS_INIT := eval $$($(LUAROCKS) --tree $(LUAROCKS_TREE) path) &&
$(NVIM_DIR):
@mkdir -p $(DEPS_DIR)
git clone --depth 1 https://github.com/neovim/neovim --branch $(NEOVIM_BRANCH) $@
@# disable LTO to reduce compile time
make -C $@ \
DEPS_BUILD_DIR=$(dir $(LUAROCKS_TREE)) \
CMAKE_BUILD_TYPE=RelWithDebInfo
CMAKE_BUILD_TYPE=RelWithDebInfo \
CMAKE_EXTRA_FLAGS='-DCI_BUILD=OFF -DENABLE_LTO=OFF'

TL := $(LUAROCKS_TREE)/bin/tl

$(TL):
$(TL): $(NVIM_DIR)
@mkdir -p $$(dirname $@)
$(LUAROCKS) --tree $(LUAROCKS_TREE) install tl $(TL_VERSION)

INSPECT := $(LUAROCKS_LPATH)/inspect.lua

$(INSPECT):
$(INSPECT): $(NVIM_DIR)
@mkdir -p $$(dirname $@)
$(LUAROCKS) --tree $(LUAROCKS_TREE) install inspect

LUV := $(LUAROCKS_TREE)/lib/lua/$(LUA_VERSION)/luv.so

$(LUV):
$(LUV): $(NVIM_DIR)
@mkdir -p $$(dirname $@)
$(LUAROCKS) --tree $(LUAROCKS_TREE) install luv

Expand Down
1 change: 1 addition & 0 deletions gen_help.lua
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ local function get_marker_text(marker)
CONFIG = gen_config_doc,
FUNCTIONS = gen_functions_doc{
'teal/gitsigns.tl',
'teal/gitsigns/attach.tl',
'teal/gitsigns/actions.tl',
},
HIGHLIGHTS = gen_highlights_doc,
Expand Down
Loading

0 comments on commit 60b4933

Please sign in to comment.