Skip to content

Instantly share code, notes, and snippets.

@delphinus
Created March 9, 2021 23:11
Show Gist options
  • Save delphinus/03eb2b746866c65cabead3ce2f606cc9 to your computer and use it in GitHub Desktop.
Save delphinus/03eb2b746866c65cabead3ce2f606cc9 to your computer and use it in GitHub Desktop.
artify.nvim <-> artify.vim benchmark
FROM ubuntu:21.04
RUN yes | unminimize
RUN apt-get update && apt-get install -y \
ninja-build gettext libtool libtool-bin autoconf automake cmake g++ \
pkg-config unzip git man-db libsqlite3-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --single-branch \
https://github.com/neovim/neovim ~/neovim \
&& cd ~/neovim \
&& git reset --hard c1fbc2d \
&& make CMAKE_BUILD_TYPE=Release \
&& make CMAKE_INSTALL_PREFIX=$HOME/local/nvim install
RUN echo 'export PATH=$HOME/local/nvim/bin:$PATH' >> ~/.bashrc
RUN echo 'nvim --version' >> ~/.bashrc
RUN mkdir -p ~/.local/share/nvim/site/pack/foo/start
WORKDIR /root/.local/share/nvim/site/pack/foo/start
RUN git clone https://github.com/sainnhe/artify.vim \
&& cd artify.vim \
&& git switch -d 503d41a
RUN git clone https://github.com/delphinus/artify.nvim \
&& cd artify.nvim \
&& git switch -d eb6c79c
WORKDIR /root
RUN mkdir -p ~/.config/nvim
RUN echo '\
local s = os.clock()\n\
for i = 1, 10000 do\n\
vim.cmd[[call artify#convert("foo", "bold")]]\n\
end\n\
print(os.clock() - s)\n\
\n\
local artify = require"artify"\n\
s = os.clock()\n\
local result = {}\n\
for i = 1, 10000 do\n\
table.insert(result, artify("foo", "bold"))\n\
end\n\
print(os.clock() - s)\n\
' >> ~/.config/nvim/init.lua
ENTRYPOINT /root/local/nvim/bin/nvim
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment