Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
romka2
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
Powerlevel10k: A Zsh Theme
(github.com)
1 points
by
romka2
6y ago
|
0 comments
2.
▲
Powerlevel10k: A Zsh Theme
(github.com)
3 points
by
romka2
6y ago
|
0 comments
3.
▲
Powerlevel10k: A Zsh Theme
(github.com)
2 points
by
romka2
7y ago
|
0 comments
4.
▲
Powerlevel10k: A Zsh Theme
(github.com)
3 points
by
romka2
7y ago
|
0 comments
5.
▲
by
romka2
7y ago
You can use powerlevel10k with the default system font. It works fine with urxvt without any twiddling.
6.
▲
by
romka2
7y ago
The minor modification would be from `$opts` to `$=opts`. I'd been using ZSH for a year as if it was Bash with better history and much better completions. The difference mentioned above was the only one I knew about. I kept writing my
7.
▲
by
romka2
7y ago
Pro tip: s/powerlevel9k/powerlevel10k/. Same config, same theme, but much faster.
8.
▲
by
romka2
7y ago
I remember reading this article back when I was still using Bash. I've finally got the history I like only after switching to ZSH. You can get decent history in ZSH just by setting the right options. If you want great history, you'
9.
▲
by
romka2
7y ago
This format looks somewhat underpowered. If one record is corrupted, there is no way to read anything after it. For the same reason there is no lookup/sharding support, such as finding the first record that starts in the second half of
10.
▲
by
romka2
7y ago
RecordIO supports a form of random access lookup, although it's rarely used. Riegeli supports random access lookups as a first-class operation.
11.
▲
by
romka2
7y ago
> That appears to be exactly RecordIO. I suppose you mean "exactly" in a figurative way. Riegeli is definitely inspired by RecordIO and is meant as a successor to it but it's not RecordIO. > Is there a reason that doesn
12.
▲
by
romka2
7y ago
There is no listed equivalent of RecordIO. What do people use for high-reliability journals? When I needed something like RecordIO to store market data, I couldn't find anything. So I implemented https://github.com/romk
13.
▲
by
romka2
7y ago
What part of the code do you expect to get faster with `-march=sandybridge -mtune=sandybridge`? > excessive ASM is a mistake these days There is no ASM in the article.
14.
▲
by
romka2
7y ago
I would agree with this sentence if "optimizing" were replaced with "making marketing claims". Optimization is the process of finding the fastest implementation. In the case of ListDir each successive version is faster t
15.
▲
by
romka2
7y ago
No, I did the opposite. I made sure the disk caches are warm before each benchmark. Since all versions of ListDir are identical in terms of IO demands, warming up caches is an effective way to reduce benchmark variability and to make perfor
16.
▲
by
romka2
7y ago
I've posted some details explaining why gitstatusd doesn't use inotify in https://github.com/romkatv/gitstatus/commit/050aaaa04b652e15... . The short version is that the default max_user_watches limi
17.
▲
by
romka2
7y ago
nftw is a wrapper over opendir/readdir, not the other way around.
18.
▲
by
romka2
7y ago
Yep, this is mentioned in the doc. > [...] every element in entries has d_type at offset -1. This can be useful to the callers that need to distinguish between regular files and directories (gitstatusd, in fact, needs this). Note how Lis
19.
▲
by
romka2
7y ago
Yep, every string is potentially an allocation (unless it's short and std::string implements Small String Optimization) plus O(log N) allocations by the vector itself. C++11 didn't make returning the vector in this function faster
20.
▲
by
romka2
7y ago
gitstatusd calls ListDir in parallel from multiple threads. At least with a fast SSD it's CPU bound. I don't have an HDD to test on.
21.
▲
by
romka2
7y ago
That's a cool algorithm. The improvements in the article look pretty small between different versions because CPU time is dominated by system calls that are out of my control. If you look at userspace CPU only, the speedup between v1 a
22.
▲
by
romka2
7y ago
> [...] have you tried core.fsmonitor with the watchman hook? I read the docs but it seems like it's not something I can enable on users' machines. Or maybe there is a way to take advantage of it even if it's not enabled?
23.
▲
by
romka2
7y ago
This directory-listing code only executes on a "cold" run of gitstatusd, which happens when you `cd` into a repo for the first time. Users obviously can tolerate higher prompt latency in this case but faster is still better.
24.
▲
by
romka2
7y ago
The real implementation of ListDir accepts the descriptor of the directory it needs to list (not parent_fd plus dirname like it's done in the article) and doesn't close it. This is fairly straightforward. You still have to pass Ar
25.
▲
by
romka2
7y ago
You are quoting a self-deprecating joke. I care deeply about my code being readable, which can be quite challenging when writing high-performance code close to the metal. I'm self-consciously aware of every tricky bit I put in my code.
26.
▲
by
romka2
7y ago
"." and ".." are filtered out before sorting. Sorting is O(N^2) in the common case (when there are fewer than 65 files in a directory), so it pays off to reduce the number of entries by 2 before we get there.
27.
▲
by
romka2
7y ago
The final implementation of ListDir has two worse-case scenarios. One is when all files have identical 8 first character but then differ almost immediately. This is bad because I'm telling memcmp that I have 256 bytes of data, which ca
28.
▲
by
romka2
7y ago
fts and ftw are glibc wrappers over glibc wrappers that I had to bypass for better performance. They are made for convenience, not for speed.
29.
▲
by
romka2
7y ago
The job of gitstatusd is to put Git status in your shell prompt. See screenshot at the top of https://github.com/romkatv/gitstatus . This is an amazingly convenient tool. When you are working on chromium, on every comma
30.
▲
by
romka2
7y ago
Thanks, that's good to know. The final version of ListDir calls memcmp only when there are files in the same directory that have identical first 8 characters. Apparently, this is rare enough that memcmp doesn't show on the CPU pro
More ›