Commit graph

3287 commits

Author SHA1 Message Date
Arun Prakash Jana 7a16440e1f
An even faster nnn - no more copying file names!
nnn has been using `struct entry` to hold both file name as well as file info.

The design forces file names to be copied in the following cases:

 - swaps during file sort (nnn uses quicksort) applied after all the matching
   files are read (in no particular order; good old readdir()) into memory.
 - swaps during manual filtering. nnn moves non-matching entries below so they
   are not encountered twice resulting in fast filtering.

There were scopes for _massive_ improvements in this area. So I did what had to
be done - decouple the file names from `struct entry` and use a separate struct
to hold the names with the indices set when the files are added by opendir().

There was a hidden problem to this approach - nnn uses realloc() to allocate
memory for file information and realloc() may move the original pointer in mem
when it can't fit the new memory to the earlier pointer. To handle that the new
algorithm tracks the change in memory location and re-adjusts the existing dir
entry names when that happens; this too, without any copying!

Though the results seem pretty clean from a theoretical point of view and early
tests, we may uncover some bugs. However, the speed is just mind-blowing!

And the binary size remains the same too!!!
2017-12-17 23:08:55 +05:30
Arun Prakash Jana 683fa65578
Add Slackware as packager 2017-12-16 23:00:23 +05:30
Arun Prakash Jana ef3eab073e
Fix indentation 2017-12-14 19:17:29 +05:30
Arun Prakash Jana c3545dd82f
Use static vars in frequently used APIs 2017-12-13 02:41:30 +05:30
Arun Prakash Jana 5ae9993a12
Retire redundant tmp vars 2017-12-13 02:32:45 +05:30
Arun Prakash Jana 1b035d6ffd
Process keypress by probable frequency 2017-12-13 01:46:50 +05:30
Arun Prakash Jana 1473416228
Update README 2017-12-09 12:07:06 +05:30
Arun Prakash Jana 6ccb8ee94b
Minor optimization, refactor 2017-12-04 19:52:35 +05:30
Arun Prakash Jana 092cdf3f82
Fix -Os compilation warnings 2017-12-03 17:36:00 +05:30
Arun Prakash Jana d6b80b380f
switch to formulae.brew.sh for Homebrew link 2017-12-02 22:29:43 +05:30
Arun Prakash Jana c70f429bc7
Use the same o/p filename in debug mode 2017-11-30 21:42:17 +05:30
Arun Prakash Jana 5ff29cede8
Fix #50: revert to -O2 optimization
The while loop in xstrlcpy() breaks when -O3 is used.
2017-11-30 21:40:52 +05:30
Arun Prakash Jana cd2bdc5991 Minor changes 2017-11-30 18:24:28 +05:30
Vlad Glagolev 9d134a3796 Add Source Mage package 2017-11-25 08:06:05 -05:00
Arun Prakash Jana ac01de1cab
Update package maintainers 2017-11-25 05:20:26 +05:30
Arun Prakash Jana f2c94a5a1c
Change button color 2017-11-17 21:13:40 +05:30
Arun Prakash Jana 56a4241d62
Add Void Linux as a package source 2017-11-06 10:20:23 +05:30
Arun Prakash Jana db6647156b
Update readme 2017-11-04 10:20:39 +05:30
Arun Prakash Jana 35f79b0bfd
Add how-to on hot plugged devices 2017-10-18 06:34:32 +05:30
Arun Prakash Jana 55abc13cd2
Minor maintenance 2017-10-16 05:24:56 +05:30
Arun Prakash Jana 6dfccce55d
Add copier script 2017-10-10 20:29:48 +05:30
Arun Prakash Jana f1a27e21af
Ignore TAB in input prompt 2017-10-09 22:55:44 +05:30
Vlad Glagolev 9638ed148d Fix a couple of warnings on BSDs (#54) 2017-10-09 07:47:02 +05:30
Arun Prakash Jana 93aac04474
archive listing is done using atool 2017-10-09 02:56:25 +05:30
Vlad Glagolev d835f72c6c Fix segfault when SHLVL env var is not available (#52) 2017-10-08 09:32:29 +05:30
Vlad Glagolev 8959a5b57d Correct name checking for NEW and RENAME (#53) 2017-10-08 09:17:32 +05:30
Vlad Glagolev 0d88940ba5 Add ExifTool URL (#51) 2017-10-08 07:13:18 +05:30
Vlad Glagolev caf368f593 OpenBSD compatibility support (#48)
* Improve compatibility with OpenBSD

* Fix indefinite blocking
2017-10-08 07:12:12 +05:30
maxice8 935fca41f1 include sys/types.h for non-glibc linux builds (#46) 2017-10-05 13:04:18 +05:30
Arun Prakash Jana 211329f5df
Use sudo to install packagecore 2017-10-05 07:21:12 +05:30
Arun Prakash Jana dcf8fbf78b
Prepare for release v1.5 2017-10-05 00:18:53 +05:30
Arun Prakash Jana 0e22a4957f
Update help 2017-10-02 23:03:45 +05:30
Arun Prakash Jana 3e74827cab
Fix alignment in examples 2017-10-02 08:17:41 +05:30
Arun Prakash Jana d62ce4bb5e
Remove redundant conversion 2017-10-01 18:59:43 +05:30
Arun Prakash Jana c66c941a97
Disable noti subscription for the same dir 2017-10-01 16:13:35 +05:30
Arun Prakash Jana 79cbc40a7f
Change archive list shortcut to 'F' 2017-10-01 04:28:48 +05:30
Arun Prakash Jana 20e8116a6c
Fix #44: document PAGER usage in certain screens 2017-09-30 05:47:38 +05:30
Arun Prakash Jana b0a806ae2e
Enable O3 optimization 2017-09-27 22:48:46 +05:30
Arun Prakash Jana 6bfbff9519
Revert "Archive handling on OS X using unar+lsar"
This reverts commit 1e859eb1370bd67cecd06b7bc8c6f885b80554bd.
We will use atool on OS X as well, it can be brewed easily.
2017-09-27 22:14:09 +05:30
Arun Prakash Jana 7c54f073fc
Archive handling on OS X using unar+lsar 2017-09-27 22:14:07 +05:30
Arun Prakash Jana 71d27de517
Support archive listing and extraction 2017-09-27 22:14:01 +05:30
Arun Prakash Jana a594c876be
Show current entry number in du mode 2017-09-27 17:37:36 +05:30
Arun Prakash Jana 082974dc8e
Show current entry number.
...because you need to know where you are.
2017-09-27 02:08:58 +05:30
Arun Prakash Jana bc76c0f7ee
Fix #42 2017-09-24 23:46:34 +05:30
Arun Prakash Jana 7a586da34d
Add badge to PPA for Ubuntu variants 2017-09-23 23:02:35 +05:30
Arun Prakash Jana f2e58288e7
nnn is on Ubuntu 17.10 2017-09-23 19:38:56 +05:30
Arun Prakash Jana 54e2bf57f8
Add step to set NNN_NOWAIT in Quickstart 2017-09-20 08:41:15 +05:30
Arun Prakash Jana 55643a5fcc
Update NNN_NOWAIT changes 2017-09-19 19:55:02 +05:30
Paul df4b557ca1 Prevent nnn from waiting on open file process (#40)
* Prevent nnn from waiting on open file process

* Add env var flag to not wait for child process when opening file

* Set nowait flag once to skip bit-or every time we open a file

* Add documentation for NNN_NOWAIT
2017-09-19 12:00:54 +05:30
Arun Prakash Jana 968beb434a
Skip entries in case fstatat() fails, do not exit 2017-09-13 18:44:27 +05:30