Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
0 replies
24 views

I was trying to read data (chars) from a large text file (~250MB) in 1KB chunks and was very surprised that reading that file using either FileReader or BufferedReader takes exactly the same time, ...
sebkaminski16's user avatar
0 votes
1 answer
30 views

In a high-performance Node.js service, I noticed that structuredClone() introduces unexpected latency spikes when cloning large nested objects (30–50 KB each). Even switching to manual cloning ...
Chand jr's user avatar
0 votes
1 answer
127 views

In our system we are hashing passwords with the following method. public static string HashPassword(string password, byte[] salt) { if (salt == null) { throw new ArgumentNullException($...
Cerkvenic's user avatar
  • 377
Advice
0 votes
2 replies
74 views

I was thinking back to WinJS or WinUI with Windows Universal Applications (WUA) from about 10 years ago. I am wondering how it compiled and avoided typical architecture errors. If there is no memory ...
LJones's user avatar
  • 35
-6 votes
1 answer
161 views

I have an object obj; and I then obtain an array arr of key-value pairs. Assuming that the key sets of obj and of arr are disjoint (i.e. no key appears in both) - how do I efficiently add all pairs in ...
einpoklum's user avatar
  • 137k
-1 votes
0 answers
28 views

I'm using Solr 9.9.0 and I recently increased the server RAM from 16 GB to 32 GB, as well as the JVM heap memory to 16 GB. The issue I'm facing is that under high load, both the Solr 9.9.0 UI ...
Abhishek's user avatar
Advice
0 votes
1 replies
50 views

We all know that there's no wrong way to write code, and infinite possible ways to complete a task. Everyone codes differently. There are of course many ways to shorthand code, so the same code can be ...
Gill P's user avatar
  • 365
0 votes
0 answers
21 views

For example, we have multiple logs that share the same structure: Order Created { ..."trace": { "order_id":123456, ... }} Order Paid { ..."trace": { "order_id":...
Mostafa El-Marzouki's user avatar
-1 votes
0 answers
160 views

I am seeding a database by copying over data from another database on the same server. In one of the tables, I am doing an INSERT INTO SELECT statement to bring over a few columns. While existing and ...
Robert Sievers's user avatar
3 votes
0 answers
150 views

I was benchmarking a naive transposition and noticed a very large performance discrepancy in performance between: a naive operation where we read data contiguously and write with a large stride; the ...
Etienne M's user avatar
  • 715
3 votes
0 answers
135 views

I noticed a significant performance deterioration when using polars dataframe join function after upgrading polars from 1.30.0 to 1.31.0. The code snippet is below: import polars as pl import time ...
Y. Gao's user avatar
  • 1,049
0 votes
0 answers
50 views

TFORM is considered a great tool for manipulating large and symbolic equations. In this thread, I’d like to share my optimization problem, which concerns a very simple operation — equations expansion. ...
kozapdh's user avatar
7 votes
1 answer
132 views

I compared the speed of normal JavaScript functions and prototype extensions. function NormalizeSpace(str) { return str.trim().replace(/\s+/g, " "); } String.prototype.NormalizeSpace = function () ...
Dr. Gut's user avatar
  • 3,335
3 votes
3 answers
232 views

I need to process 100 Gigabytes of logs in a weird format, then do some analysis on the results. Initial parts of parsing and CLI done, tried on some test data with 1 GB and it took around a minute. I ...
nemo nemo's user avatar
2190 votes
42 answers
3.1m views

I want to measure the time it took to execute a function. I couldn't get timeit to work: import timeit start = timeit.timeit() print("hello") end = timeit.timeit() print(end - start)
gilbert8's user avatar
  • 21.9k
-5 votes
1 answer
213 views

I'm writing code that must perform a dot product between a vector b and a matrix C, where the dot is performed between b and each line of C. I made two implementation, one in C++ and one in Python. ...
alexcrespao's user avatar
Best practices
0 votes
0 replies
42 views

I'm working on a Next.js 14 app with several dynamic routes (e.g., /product/[id]) that render product details from a large dataset (around 50k+ records) stored in PostgreSQL. I'm using ...
Mina Golzari Dalir's user avatar
0 votes
0 answers
147 views

I have implemented the quicksort algorithm using the last element as the pivot. Now I want to generate an array for the best-case scenario. This is the function that I wrote, but I am not sure that it ...
Claudiu's user avatar
0 votes
2 answers
72 views

I have an instance of ReadOnlyMemory<byte> over a byte[] that I need to convert to ArraySegment<byte>. I'm doing this as part of a major code refactor, and I'm having to adapt an existing ...
Matt Davis's user avatar
  • 46.3k
3068 votes
12 answers
378k views

It is my understanding that the range() function, which is actually an object type in Python 3, generates its contents on the fly, similar to a generator. This being the case, I would have expected ...
Rick's user avatar
  • 45.6k
0 votes
1 answer
44 views

My implementation of an API function doing a simple SPI transfer, offering a void *intfPtr parameter to pass a "device descriptor" which I am using to pass the I/O port and pin for SPI chip ...
Torsten Römer's user avatar
-2 votes
1 answer
81 views

I see in many existing ABAP programs that standard internal tables are declared without key fields, for instance: TYPES type_itab TYPE STANDARD TABLE OF sflight WITH DEFAULT KEY. DATA itab_0 TYPE ...
Sandra Rossi's user avatar
1753 votes
34 answers
946k views

Project Euler and other coding contests often have a maximum time to run or people boast of how fast their particular solution runs. With Python, sometimes the approaches are somewhat kludgey - i.e., ...
Chris Lawlor's user avatar
  • 49.4k
-4 votes
1 answer
62 views

📝 Body I have a Mongo collection CollectionA where each top-level object contains a nested array of meetings now each meetings have start and end times, for example: CollectionA = [ { &...
LEO_007's user avatar
  • 51
0 votes
1 answer
192 views

First, to define what I'm talking about, the "length" of a source is how many characters it has. Having more characters allows improving readability by using more descriptive function and ...
Vladimirs Kacs's user avatar

1
2 3 4 5
2056