Questions tagged [optimization]
The optimization tag has no usage guidance.
60
questions
0
votes
2
answers
61
views
Difference behavior of C program compiled with GNU -O2 and -O3
I am working on an embedded Linux system (5.10.24), and there are several applications running in it.
Recently, I found something strange with one C program as follows.
The C program uses APIs ...
0
votes
1
answer
23
views
Could use docker for app isolation?
I am studying the use of Docker in a big scale project that is actually deployed on production. I never used docker before, but for what I read, it consinst about a new layout called "Container ...
0
votes
0
answers
44
views
Optmization and tuning Linux Server (Mediaserver)
I rebuilt a server, specifically a mediaserver, based on debian 12 stable (kernel 6.1).
CPU: i7-6700K(no overclock)
RAM: 16GB DDR4 (dual channel)
NIC: 2 of 2.5Gbit (bonding balance-tlb) (MTU bond0: ...
0
votes
0
answers
79
views
Big Maildir mailspool - looking for ways to improve performance
I have an extremely large Maildir which contains emails going back many years. I need to rebuild the server and would like to improve the mail storage setup.
My main problem is that backups of the ...
0
votes
0
answers
101
views
PostgreSQL: indexes and partitions
I have a PostgreSQL database and I noticed a weird behaviour while working with indexes and partitions. The engine version is 10.21.
Now, I have a table with this structure:
guid varchar(50) PK
guid_a ...
1
vote
1
answer
155
views
Speed up grep usage inside bash script
I am currently working on creating a bash script that is supposed to process large log files from one of my programs. When I first started the script took around 15 seconds to complete which wasn't ...
0
votes
1
answer
246
views
Parse huge amounts of files efficiently
I have a folder that holds hunderds of thousands of files called hp-temps.txt. (There are also tons of subfolders)
The content of these files looks like this for example:
Sensor Location ...
0
votes
1
answer
748
views
CLI tool that compress the given image, whatever file type the image is (png, jpg, gif, webp, svg)?
I know that there are many tools to optimize an image:
pngquant
optipng
jpegoptim
gifsicle
exiftool
ecc
but they are all specific for a certain file type. Is there a single command line that, ...
1
vote
0
answers
190
views
Pipewire using 2x processes when idling
I recently had my BT headphones stutter and cut out and realized that during CPU intensive processing, pipewire is dropping frames. My overall goal, then, is to streamline processing to make that ...
1
vote
0
answers
351
views
Can't compile linux kernel with -Og/-O0 option for debugging purpoces
Having custom hardware running embedded Linux (OpenWrt) like a charm. CPU - is IMX6ULL (ArmV7) so it is supported by Jlink to debug over JTAG interface.
Starting GDB server and step by step debugging ...
0
votes
0
answers
188
views
Why integer division is faster than bitwise shift in shell?
I'm comparing performance of bash and dash (default sh in Xubuntu 18.04).
I expect sh to be faster than bash
I expect bitwise shift to be faster than division operator.
However, I'm getting ...
1
vote
0
answers
532
views
Is jq internal sort slower than GNU sort?
While filtering through this json file I did a benchmark and found out utilizing jq's internal sort and unique method is actually 25% slower than sort --unique!
Command
Mean [ms]
Min [ms]
Max [ms]
...
1
vote
2
answers
572
views
How to Build Latest HandBrake on linux with FDO (PGO) + LTO?
Passing CFLAGS and CXXFLAGS to a HandBrake build for the latest version (v1.3.3 at the time of this writing) will work until you add -flto which will FAIL the whole build.
How to build HandBrake with ...
1
vote
0
answers
54
views
How can I frequently update a file without harming my disk?
I've got an i3 install on a laptop with an SSD. Currently I have it configured to save the WM layout on many different events. The tool that I'm using to do this is built on Python, and I'm just ...
-1
votes
2
answers
44
views
Optimize time when creating archive
Currently I am using the following command to create an archive with files older than 7 days:
find /var/tunningLog/ -type f -mtime +7 -print0 | tar -czf "/var/tunningLog/$(date '+%Y-%m-%d').tar....
0
votes
1
answer
216
views
Optimal command-line search inside a sorted text file
Let's say I have a text file with billions of text lines sorted alphabetically, like
Bar=10
Foo=6
Naz=42
How can I search for the line starting with Foo in the most optimal way (the file contains ...
4
votes
1
answer
362
views
Is there an equivalent to Jason Randolph's Super Duper mode vim re-mapping for Linux?
I'm very interested in moving from my Mac to a Linux system. The main barrier is my dependence on Jason Rudolph's Keyboard. Specifically, I need an equivalent to (S)uper (D)uper Mode. Super Duper ...
2
votes
1
answer
605
views
How to pipe output of command to two separate commands and store outputs
I have a really long command that runs over a huge file and I am forced to run it twice which doubles the time it takes to run.
This is what I am doing at the moment:
x=$(command | sort -u)
y=$(...
2
votes
1
answer
200
views
KSM / MADVISE : Init & usage in standard desktop environment
Running a 4.19 linux kernel + couple of patches RT oriented + occasionally running a couple of processes SCHED_RR (for "pro"-audio purposes)
CONFIG_KSM set in the kernel and ksmd running, I ...
1
vote
1
answer
3k
views
Build the Linux kernel without gcc optimization
I follow one of many tutorials found on Google results to build and debug the Linux kernel with gcc and kgdb/gdb. And I end up by discovering that is all waste of time. Since I can't compile the ...
0
votes
1
answer
29
views
Timing desktop environment initialization
Is there a way to time desktop environment initialization and perhaps identify delaying candidates?
-3
votes
1
answer
270
views
Why don't BSD kernels use likely() unlike Linux does?
As pointed out in an answer, there's some use of similar hints to compiler in say, FreeBSD and OpenBSD, but those hints coverage of Linux kernel code is a few magnitudes higher. It might make sense to ...
0
votes
2
answers
175
views
How to resize images on sequential functions?
I am trying to:
change the format of my images,
then resize their height and width of 40%
then optimize their quality to 35% max of the source and the total size of the image to 35% of the origin.
...
0
votes
0
answers
54
views
Optimize raid drive for disk read
I have a Hardware RAID10 setup at home for my home server. I run a Plex Media server and a Nextcloud cloud server for my family at home. My concern is, that when I am downloading a movie (heavy disk ...
2
votes
1
answer
1k
views
Can I compile Linux kernel with -Ofast?
I want to know if compiling the Linux kernel with -Ofast is:
Worth it.
Supported (what level of optimization do the kernel writers take into account?)
Secure.
The question arised because ...
-1
votes
1
answer
735
views
What are all the possible optimizations I could apply to a new build of Gentoo? [closed]
With the assumption that I'm using hardware with a very modern CPU (9900K), what are all the possible optimizations I could apply to a new build of Gentoo in order to gain the best possible ...
1
vote
0
answers
415
views
how do I emerge gcc 9 on gentoo without creating too many processes?
I am stuck on building gcc 9 with lto USE flag, because it is creating over 30 lto processes when I try to do so. At this point, I have to reboot my PC. I think it may have to do with the new lto ...
-1
votes
2
answers
2k
views
Is it safe to disable clamscan and clamd services on linux server
We have a dedicated CentOS server with 8 CPUs. We often observe clamscan and clamav taking too much CPU. I have heard experts saying linux doesn't require an antivirus. If that is true, is it safe to ...
1
vote
1
answer
545
views
Speed up random sort and delete (rm) for multiple directories
Running MacOS in a terminal which is essentially BSD, hence posting my question here instead of askdifferent. I want to trim my image dataset down in subsequent steps, by deleting files randomly. Some ...
3
votes
0
answers
2k
views
Compile a library aiming to reduce size as much as possible
I have to 'squeeze' all the needed code to run ldaps on an embedded system. So the 3 MiB of lybcrypto and almost 700KiB of libssl are way too much.
I'm now experimenting on ldapsearch because reading ...