GNU nano - Bugs: bug #59028, [Wish] an option to switch off the...
You are not allowed to post comments on this tracker with your current authentication level.
bug #59028: [Wish] an option to switch off the use of libmagic
Submitter: | Benno Schulenberg <bens> | ||
Submitted: | Fri 28 Aug 2020 08:11:27 AM UTC | ||
Severity: | 1 - Wish | Status: | Fixed |
Assigned to: | bens | Open/Closed: | Closed |
Thu 08 Oct 2020 08:55:04 AM UTC, comment #5: |
Benno Schulenberg <bens>![]() ![]() |
Fri 25 Sep 2020 02:41:27 PM UTC, comment #4: Fixed in git, commit 58a3293e, by requiring --magic or 'set magic' to enable the use of libmagic.
|
Benno Schulenberg <bens>![]() ![]() |
Mon 31 Aug 2020 02:34:31 PM UTC, comment #3: Here are some measurements on four different machines. Apart from the laptop, all these machines have a real, spinning disk; the laptop has flash storage. The "cold" columns list the average total startup time of nano upon its first run of the day (simulated with 'echo 3 >/proc/sys/vm/drop_caches'), and the "rerun" columns list the time of a warm start, when all needed files are already cached in RAM. All times are in milliseconds.
When doing a cold start, disabling the use of magic saves some 150 ms (when having a spinning disk). Compared to the total startup time of 900 to 1500 milliseconds, this saving hardly seems worth the trouble. But when having flash storage, disabling magic saves a full third of the startup time. That is worth it.
|
Benno Schulenberg <bens>![]() ![]() |
Sat 29 Aug 2020 11:22:09 AM UTC, comment #2: Well, it results that it doesn't make any significant difference whether a machine has a real disk or flash storage. Below, the netbook, the old box, and the desktop all have a real disk, the laptop has flash storage. The first three machines all have a low-end processor, and the desktop machine has an i5.
I'm surprised that on the relatively fast i5 machine the time to do the magic stuff is only roughly three to four times the time it takes to do the normal regexes, whereas on the slower machines the magic takes roughly fifteen times more time. It must have something to do with the better processor also having more L1/L2/L3 cache, allowing it keep more stuff close to the processor and thus do the magic stuff so much faster.
|
Benno Schulenberg <bens>![]() ![]() |
Fri 28 Aug 2020 08:32:43 AM UTC, comment #1: On my machine, running fruitlessly through all the filename regexes and headerline regexes takes 1.4 milliseconds. Doing a fruitless magic search takes 23.5 milliseconds.
|
Benno Schulenberg <bens>![]() ![]() |
Fri 28 Aug 2020 08:11:27 AM UTC, original submission:
Almost all distros build a vanilla nano, without disabling anything during ./configure, which means that libmagic will be enabled. But the average user uses nano mostly to edit some config files, and most of these config files are not covered by any specific syntax, which means that trying to determine the syntax with a call to magic_file() is just a waste of time.
|
Benno Schulenberg <bens>![]() ![]() |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Option --magic and 'set magic' was released in version 5.3.