Skip to content

performance factors

Arun Prakash Jana edited this page Mar 9, 2019 · 29 revisions

nnn uses highly optimized algorithms. Some of the significant factors are listed below:

  • quicksort with pre-filters to sort files based on filename, modification time, size etc.
  • 0 fragmentation - no byte loss while saving file name of directory entries
  • no copying of filename strings while sorting/filtering
  • non-matching entries are moved to the lowest slots in filter mode to ignore them in later comparisons
  • increased number of open file descriptors
  • all the large buffers are aligned
  • frequently used structures optimized to facilitate SSE quad-instruction support
  • extremely fast routines to calculate and render file size
  • no floating point arithmetic
  • shifts instead of divisions and multiplications (probably done by most modern compilers already)
  • optimized memory usage everywhere, buffer re-use, restricted dynamic memory (de)allocation
  • static routines
  • controlled binary size (~50KB)
  • O3 level compiler optimization
  • 0-warning statically-analyzed code (forced -Wall -Wextra -Werror in Travis CI)

However, we had been most careful not to obfuscate the code. It's reasonably well-documented too!

You can’t perform that action at this time.