joaotavora / yasnippet

A template system for Emacs
http://joaotavora.github.io/yasnippet/
2.76k stars 314 forks source link

Reducing package extraction time by allowing more than one snippet definition per file #1004

Open cpitclaudel opened 5 years ago

cpitclaudel commented 5 years ago

Hi there,

I've recently noticed that when I update my Emacs packages, by far the longest step is updating yasnippet package collections. Emacs is fairly slow to untar packages on my machine, and so extracting each snippet file from a collection takes a lot of time (tens of seconds to install yasnippet-snippets). Being able to put multiple snippets in a single file would solve this problem: yasnippet-snippets could ship a single file per language, for example.

As mentioned in https://github.com/joaotavora/yasnippet/issues/705 there is already a way to compile a directory of snippets into a single file, but the output is not nicely editable. It would be great to be able to store more than one snippet per file in the original format. Maybe by separating each snippet with a ^L? (this is C-l, ASCII 0x0C; AFAICT, no existing snippet uses that character)

Thanks for the hard work!

npostavs commented 5 years ago

I'd rather fix this in Emacs, see https://debbugs.gnu.org/35909

cpitclaudel commented 5 years ago

I'm not sure it's an Emacs-only problem: yasnippet is 1/3 of all files (1600 / 4700) in my ELPA directory, which shows in backups and FS scans, for example (arguably, the main problem is Emacs; but it shows even in other circumstances).

cpitclaudel commented 5 years ago

Thanks for the link, btw! Sorry I didn't find it first :'(

npostavs commented 5 years ago

yasnippet is 1/3 of all files (1600 / 4700) in my ELPA directory, which shows in backups and FS scans, for example

How is that a problem though?

Sorry I didn't find it first :'(

I only posted that after you made this report, so you would have needed a time machine to find it first ;)

cpitclaudel commented 5 years ago

How is that a problem though?

It wastes time, mostly. On slow hardware, or with a high-latency connection, it makes backups slower than needed (this is particularly egregious with samba or on systems running off an SD card). I think this is why mbox is sometimes preferred for emails over maildir.

I only posted that after you made this report, so you would have needed a time machine to find it first ;)

Phew.

npostavs commented 5 years ago

It wastes time, mostly. On slow hardware, or with a high-latency connection, it makes backups slower than needed (this is particularly egregious with samba or on systems running off an SD card). I think this is why mbox is sometimes preferred for emails over maildir.

Fair enough.