summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-02-07scan.zig: Revamp output API, reduce buffering a bit, re-add UIzig-threadedYorhel3-450/+486
New output API takes over (most of) the buffering responsibilites from the scanning code, simplifying that code and allowing for a few minor optimizations, such as not buffering at all when scanning into RAM and buffering directly into JSON strings when exporting. This is mostly yak shaving, hopefully allowing for further performance improvements to be implemented later. The new API could also be extended to support parallel scanning of disjoint trees, in case current approach isn't working out too well. Also re-added the progress UI and improved propagating read errors. A visible side effect of the new API is that the progress UI now displays the most recent directory being scanned rather than individual files. Not a big loss, I hope?
2022-02-07Parallel scanning: early proof-of-concept implementationYorhel3-77/+300
And it's not looking well; this implementation seems to be 3x slower in the hot cache scenario with -J8, which is a major regression. There's way too much lock contention and context switching. Haven't tested with actual disk I/O yet and I've not yet measured how much parallelism this approach will actually get us in practice, nor whether the disk access patterns of this approach make a whole lot of sense. Maybe this low-memory approach will not work out and I'll end up rewriting this to scan disjoint subtrees after all. TODO: - Validate how much parallelism we can actually get with this algorithm - Lots of benchmarking and tuning (and most likely some re-architecting) - Re-implement exclude pattern matching - Document -J option - Make OOM handling thread-safe
2022-02-07Version 2.1; remove 1.x changes from the ChangeLogv2.1Yorhel2-194/+11
2022-02-07Fix compilation on 32bit systemsYorhel1-1/+1
Broken in 7d2905952d956801050baaed08eb092fb22f661f
2022-02-05scan: Add UI message when counting hard linksYorhel1-2/+17
That *usually* doesn't take longer than a few milliseconds, but it can take a few seconds for some extremely large dirs, on very slow computers or with optimizations disabled. Better display a message than make it seem as if ncdu has stopped doing anything.
2022-02-03Add --graph-style option and Unicode graph drawingYorhel3-6/+30
And also adjust the graph width calculation to do a better job when the largest item is smaller than the number of columns used for the graph, which would previously draw either nothing (if size = 0) or a full bar (if size > 0). Fixes #172.
2022-02-03Use natsort when sorting by nameYorhel2-3/+108
Fixes #181, now also for Zig.
2022-02-02Mention --ignore-config flag when reading config failsYorhel1-3/+3
2022-02-02Ignore ENOTDIR when trying to open config filesYorhel1-0/+1
2022-02-02browser: Fix long file name overflow + unique size display glitchYorhel1-2/+2
2022-01-01Version 2.0.1 + copyright year bumpv2.0.1Yorhel13-14/+19
2022-01-01Makefile: Add ZIG_FLAGS variableYorhel1-1/+2
Fixes #185
2021-12-26ui.zig: Really fix import of wcwidth() this timeYorhel1-1/+1
Fixes #183
2021-12-21ui.zig: Fix typo in setting _XOPEN_SOURCE feature test macroYorhel1-1/+1
2021-12-21Version 2.0v2.0Yorhel2-1/+5
I'm tagging this as a "stable" 2.0 release because the 2.0-beta# numbering will get confusing when I'm working on new features and fixes. It's still only usable for people who can use the particular Zig version that's required (0.9.0 currently) and it will certainly break on different Zig versions. But once you have a working binary for a supported arch, it's perfectly stable.
2021-12-21Fixes and updates for Zig 0.9.0Yorhel8-118/+107
2021-11-09Version 2.0-beta3v2.0-beta3Yorhel3-2/+12
2021-11-02Fix export featureYorhel1-1/+1
...by making sure that Context.parents is properly initialized to null when not scanning to RAM. Fixes #179.
2021-10-07Make options, keys and file flags bold in man pageYorhel1-62/+62
Port of 96a923192726f4ce77b5168a17f7a8355e6f2238
2021-10-06Fix defaults of scan_ui and --enable-* flagsYorhel1-4/+4
Bit pointless to make these options nullable when you never assign null to them.
2021-10-06Fix double-slash prefix in path display when scanning rootYorhel1-1/+1
2021-10-06Fix import of "special" dirs and excluded itemsYorhel1-1/+4
2021-10-06Fix use-after-free in argument parsingYorhel1-1/+1
Introduced in 53d3e4c112a475ecbaae42cc1e58d42b986d76fc
2021-10-06Add --ignore-config command line optionYorhel2-10/+27
2021-10-06Add reference to "man ncdu" in --help textYorhel1-18/+23
Not going to bloat the help output with all those settings...
2021-10-06Make argument parsing code non-generic and simplify config file parsingYorhel2-168/+117
Saves about 15k on the binary size. It does allocate a bit more, but it also frees the memory this time.
2021-10-06Add configuration file supportYorhel4-112/+228
2021-10-06Add CLI options for default sortYorhel2-1/+43
2021-10-05Add CLI options for all UI settingsYorhel3-61/+123
+ reorder manpage a bit, since the scan options tend to be more relevant than all those UI options. Again, these are mainly useful with a config file.
2021-10-05Document the 'u' keyYorhel2-2/+7
Might as well keep it. The quick-config menu popup idea can always be implemented later on, we're not running out of keys quite yet.
2021-10-05Add CLI options for individual -r features and to counter previous optionsYorhel3-60/+88
The --enable-* options also work for imported files, this fixes #120. Most other options are not super useful on its own, but these will be useful when there's a config file.
2021-09-28Don't enable -x by defaultYorhel1-1/+1
That was an oversight. Especially useless when there's no option to disable -x.
2021-08-16Add dark-bg color scheme + enable colors by default if !NO_COLORYorhel3-56/+80
Same thing as commit 376aad0d350657d959a3ac1713a4a86b20ae30d1 in the C version.
2021-07-31Version 2.0-beta2 + more convenient static binary generationv2.0-beta2Yorhel3-18/+33
2021-07-28Keep track of uncounted hard links to speed up refresh+delete operationsYorhel1-5/+29
2021-07-28Fix Dir.fmtPath() when given the root dirYorhel1-1/+2
2021-07-28Fix reporting of fatal scan error in -0 or -1 UIsYorhel1-0/+2
2021-07-28Implement a more efficient hard link counting approachYorhel4-271/+199
As aluded to in the previous commit. This approach keeps track of hard links information much the same way as ncdu 1.16, with the main difference being that the actual /counting/ of hard link sizes is deferred until the scan is complete, thus allowing the use of a more efficient algorithm and amortizing the counting costs. As an additional benefit, the links listing in the information window now doesn't need a full scan through the in-memory tree anymore. A few memory usage benchmarks: 1.16 2.0-beta1 this commit root: 429 162 164 backup: 3969 1686 1601 many links: 155 194 106 many links2*: 155 602 106 (I'm surprised my backup dir had enough hard links for this to be an improvement) (* this is the same as the "many links" benchmarks, but with a few parent directories added to increase the tree depth. 2.0-beta1 doesn't like that at all) Performance-wise, refresh and delete operations can still be improved a bit.
2021-07-26Add parent node pointers to Dir struct + remove Parents abstractionYorhel5-228/+153
While this simplifies the code a bit, it's a regression in the sense that it increases memory use. This commit is yak shaving for another hard link counting approach I'd like to try out, which should be a *LOT* less memory hungry compared to the current approach. Even though it does, indeed, add an extra cost of these parent node pointers.
2021-07-23ChangeLog, tooYorhel1-1/+1
2021-07-23Fix README Zig version oopsieYorhel1-1/+1
2021-07-22Tagging this as a 2.0-beta1 releasev2.0-beta1Yorhel3-66/+29
2021-07-19Fix counting of sizes for new directoriesYorhel1-1/+1
2021-07-19Fix building of static binariesYorhel1-10/+13
It's a bit ugly, but appears to work. I've not tested the 32bit arm version, but the others run. The static binaries are about twice as large as the ncdu 1.x counterparts.
2021-07-18scan: Don't allocate directory iterator on the stackYorhel1-2/+3
I had planned to checkout out async functions here so I could avoid recursing onto the stack alltogether, but it's still unclear to me how to safely call into libc from async functions so let's wait for all that to get fleshed out a bit more.
2021-07-18Implement help windowYorhel2-10/+155
The rewrite is now on feature-parity with ncdu 1.x. What remains is bugfixing and polishing.
2021-07-18Add REUSE-compliant copyright headersYorhel16-23/+57
2021-07-18Add Makefile with some standard/handy toolsYorhel4-6/+88
+ a failed initial attempt at producing static binaries.
2021-07-16Store Ext before EntryYorhel2-18/+16
Which is slightly simpler and should provide a minor performance improvement.
2021-07-16Use @errorName() fallback in ui.errorString()Yorhel1-4/+2
Sticking to "compiletime-known" error types will essentially just bring in *every* possible error anyway, so might as well take advantage of @errorName.