Bug 253417

Summary: editors/neovim: Add LTO option
Product: Ports & Packages Reporter: Piotr Kubaj <pkubaj>
Component: Individual Port(s)Assignee: Adam Weinberger <adamw>
Status: Closed Works As Intended    
Severity: Affects Some People CC: adamw
Priority: --- Keywords: feature, needs-qa, performance
Version: LatestFlags: bugzilla: maintainer-feedback? (adamw)
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch
none
patch pkubaj: maintainer-approval? (adamw)

Description Piotr Kubaj freebsd_committer freebsd_triage 2021-02-10 21:31:59 UTC
Created attachment 222343 [details]
patch

This patch adds option for using LTO.
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2021-02-10 22:46:03 UTC
I'm certainly not opposed, but I'm just surprised that LTO would make much difference in a text editor that spends most of its time either IO-bound or waiting for keystrokes.

Do you find a noticeable change with this enabled?
Comment 2 Piotr Kubaj freebsd_committer freebsd_triage 2021-02-10 22:52:33 UTC
Created attachment 222345 [details]
patch

Corrected patch.

I actually don't use neovim. I just noticed that FreeBSD ports in general have poor support for LTO and want to add support for that.

I think it actually might make a difference when used with large files.
Comment 3 Adam Weinberger freebsd_committer freebsd_triage 2021-02-10 23:03:47 UTC
It looks like neovim actually enables it by default:

CMakeLists.txt:
if (MINGW)
  # Disable LTO by default as it may not compile
  # See https://github.com/Alexpux/MINGW-packages/issues/3516
  # and https://github.com/neovim/neovim/pull/8654#issuecomment-402316672
  option(ENABLE_LTO "enable link time optimization" OFF)
else()
  option(ENABLE_LTO "enable link time optimization" ON)
endif()
Comment 4 Adam Weinberger freebsd_committer freebsd_triage 2021-02-16 15:25:39 UTC
I'm closing out this PR, as it looks like neovim already does this.