I'm trying to figure out the best way to find the number of files in a particular directory when there are a very large number of files (more than 100,000).
When there are that many files, performing ls | wc -l takes quite a long time to execute. I…
My java program spends most time by reading some files and I want to optimize it, e.g., by using concurrency, prefetching, memory mapped files, or whatever.
Optimizing without benchmarking is a non-sense, so I benchmark. However, during the…
i am a student just starting out with python, and i was tasked with creating a relational database management system. I think i came pretty far, but i seem to have hit a wall. This is my code:
import csv
import sqlite3
conn =…
I have implemented a suffix tree in Python to make full-text-searchs, and it's working really well. But there's a problem: the indexed text can be very big, so we won't be able to have the whole structure in RAM.
IMAGE: Suffix tree for the word…
Can I write to different parts of the same file concurrently from multiple threads (on a typical PC)? I mean there's only one disk head, so the writes can be only performed in some order anyway i.e. not in parallel, right?
Edit:
I'm writing a…
I have a project with dagger setup with following provider method:
@Module(...)
abstract class AppModule {
@Module
companion object {
...
@Provides
@Singleton
@JvmStatic
fun provideSharedPreferences(@AppContext context:…
I've always used a FileWriter to write text to a file in Java. Apparently you can also use a BufferedOutputStream as well. After reading both javadocs carefully, I can't seem to tell which was is faster/more efficient.
So I ask: is there a…
My MySQL application is experiencing slow performance when running some UPDATE, INSERT and DELETE queries. In this question, I will only discuss one particular UPDATE, because it's enough to demonstrate the problem:
UPDATE projects SET ring = 5…
I am running a very simple program, which is trying to list files in a folder on the same machine, which is specified using UNC format(as described in http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx):
static…
Background:
I'm developing a database related program, and I need to flush dirty metadata from memory to disk sequentially.
/dev/sda1 is volumn format, so data on /dev/sda1 will be accessed block by block and the blocks are adjacent physically if…
If the following database (postgres) queries are executed, the second call is much faster.
I guess the first query is slow since the operating system (linux) needs to get the data from disk. The second query benefits from caching at filesystem level…
I am having a call to getExternalCacheDir() function on my Android App, and this is causing an ANR for some of Android 10 users having the following devices (HUAWEI P30 lite, Galaxy A40, Xperia XZ3).
I am having the following stack trace for my…
I am getting the following stats for my redis while running docker stats command.
I want to know about NET I/O and BLOCK I/O. I read few documentation they are saying about BLOCK I/O is something related to disk operation. But I am not sure what…
I created a programme to test sharded MongoDB performance on Linux(Ubuntu) and Windows(Server2008).
With inserting large quantity of records, Windows's disk's active time is very high(100%), then performance is very bad. But on Ubuntu, the disk's…
There are 81 million files (!) stored in one directory on a remote machine. All files end in ".paintedHaploDiversity". I would like to merge those files into one called allOutputs_3.5 in the parent directory. More specifically, each file contains…