Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU usage #4073

Closed
listeningwing opened this issue Sep 10, 2024 · 2 comments
Closed

High CPU usage #4073

listeningwing opened this issue Sep 10, 2024 · 2 comments

Comments

@listeningwing
Copy link

listeningwing commented Sep 10, 2024

using mmap for performance.

@masatake
Copy link
Member

masatake commented Sep 10, 2024

A pull request with the results of benchmarks is welcome.
I don't think the ideas improve the performance that can be measured with time command.

a. Nice or renice commands may be what you want (if you use GNU/Linux).

b. If you use glibc, you can ask fopen to use mmap internally by specifying m. See https://sourceware.org/glibc/manual/2.40/html_node/Opening-Streams.html . However, I don't expect any performance improvement because in most cases, ctags accesses input files sequentially. The buffering mechanism behind fopen and fgetc may work as if we use mmap for sequential access.

Unlike ctags, readtags accesses tag files randomly. So mmap may improve the performance. I already added m flag to open. universal-ctags/libreadtags@c0f0107

@masatake
Copy link
Member

An article read(2) vs mmap(2) の迷信 written in Japanese helps us think about the b.

@masatake masatake closed this as not planned Won't fix, can't repro, duplicate, stale Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants