Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nccf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
702
Provoz
nccf
Commits
e72768b8
Commit
e72768b8
authored
3 years ago
by
Yorhel
Browse files
Options
Downloads
Patches
Plain Diff
Tagging this as a 2.0-beta1 release
parent
a915fc08
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ChangeLog
+17
-0
17 additions, 0 deletions
ChangeLog
README.md
+11
-65
11 additions, 65 deletions
README.md
src/main.zig
+1
-1
1 addition, 1 deletion
src/main.zig
with
29 additions
and
66 deletions
ChangeLog
+
17
−
0
View file @
e72768b8
# SPDX-FileCopyrightText: 2021 Yoran Heling <projects@yorhel.nl>
# SPDX-License-Identifier: MIT
2.0-beta1 - 2021-07-22
- Full release announcement: https://dev.yorhel.nl/doc/ncdu2
- Requires Zig 8.0
- Lower memory use in most scenarios (except with many hard links)
- Improved performance of hard link counting
- Extra column for shared/unique directory sizes
1.16 - 2021-07-02
- Increase width of size bar depending on terminal size (Christian Göttsche)
- Set/increment $NCDU_LEVEL variable when spawning a shell
- Indicate whether apparent size or disk usage is being displayed
- Display setuid, setgid and sticky bits in file flags in extended mode
- Fix error handling while reading --exclude-from file
- Improve JSON import to allow for several future extensions to the format
- Export link count in JSON dumps
- Don't export inode in JSON dumps for non-hardlinks
1.15.1 - 2020-06-10
- (Linux) Fix build on older Linux systems (Christian Göttsche)
- (MacOS) Revert "Exclude firmlinks by default" behavior (until we have a better solution)
...
...
This diff is collapsed.
Click to expand it.
README.md
+
11
−
65
View file @
e72768b8
...
...
@@ -13,70 +13,9 @@ available, but it is a useful tool even on regular desktop systems. Ncdu aims
to be fast, simple and easy to use, and should be able to run in any minimal
POSIX-like environment with ncurses installed.
## This Zig implementation
This branch represents an experimental rewrite of ncdu using the
[
Zig
programming language
](
https://ziglang.org/
)
. It is supposed to be fully
compatible (in terms of behavior, UI and CLI flags) with the C version, so it
can eventually be used as a drop-in replacement.
Since Zig itself is still very much unstable and things tend to break with each
release, I can't in good conscience publish this rewrite as a proper release of
ncdu (...yet). I intent to maintain the C version as long as necessary while
Zig matures and gets more widely supported among Linux/BSD systems.
This rewrite is a test-bed for various improvements to the design of ncdu that
would impact large parts of its codebase. The improvements may also be
backported to the C version, depending on how viable a proper Zig release is.
### Improvements compared to the C version
-
Significantly reduced memory usage, achieved by:
-
Removing pointers between nodes that are not strictly necessary for basic
tree traversal (this impacts
*all*
code in the C version of ncdu).
-
Using separate structs for directory, file and hard link nodes, each storing
only the information necessary for that particular type of node.
-
Using an arena allocator and getting rid of data alignment.
-
Refreshing a directory no longer creates a full copy of the (sub)tree.
-
Improved performance of hard link counting (fixing
[
#121
](
https://code.blicky.net/yorhel/ncdu/issues/121
)
).
-
Add support for separate counting hard links that are shared with other
directories or unique within the directory (issue
[
#36
](
https://code.blicky.net/yorhel/ncdu/issues/36
)
).
-
Faster --exclude-kernfs thanks to
`statfs()`
caching.
-
Improved handling of Unicode and special characters.
-
Key to switch to path from a file's hard link listing.
-
Remembers item position when switching directories.
Potentially to be implemented:
-
Faster --exclude-pattern matching
-
Multithreaded scanning
-
Exporting a JSON dump after scanning into RAM
-
Transparent dump (de)compression by piping through gzip/bzip2/etc
### Regressions compared to the C version
Aside from this implementation being unfinished:
-
Assumes a UTF-8 locale and terminal.
-
No doubt somewhat less portable.
-
Listing all paths for a particular hard link requires a full search through
the in-memory directory tree.
-
Not nearly as well tested.
-
Directories that could not be opened are displayed as files.
-
The disk usage of directory entries themselves is not updated during refresh.
### Minor UI differences
Not sure if these count as improvements or regressions, so I'll just list these
separately:
-
The browsing UI is not visible during refresh or file deletion.
-
Some columns in the file browser are hidden automatically if the terminal is
not wide enough to display them.
-
The file's path is not displayed in the item window anymore (it's redundant).
-
The item window's height is dynamic based on its contents.
See the
[
ncdu 2 release announcement
](
https://dev.yorhel.nl/doc/ncdu2
)
for
information about the differences between this Zig implementation (2.x) and the
C version (1.x).
## Requirements
...
...
@@ -86,4 +25,11 @@ separately:
## Install
**todo**
You can use the Zig build system if you're familiar with that.
There's also a handy Makefile that supports the typical targets, e.g.:
```
make
sudo make install PREFIX=/usr
```
This diff is collapsed.
Click to expand it.
src/main.zig
+
1
−
1
View file @
e72768b8
// SPDX-FileCopyrightText: 2021 Yoran Heling <projects@yorhel.nl>
// SPDX-License-Identifier: MIT
pub
const
program_version
=
"2.0-
dev
"
;
pub
const
program_version
=
"2.0-
beta1
"
;
const
std
=
@import
(
"std"
);
const
model
=
@import
(
"model.zig"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment