Category "performance"

How to compare 1,000 images using the available memory efficiently

This is a tough problem. I have around 1,000 images stored in my disk, and I want to find images that are similar to each other by comparing them in pairs. So I

Laravel Eloquent vs DB facade: Why use Eloquent and decrease performance? [closed]

I did some performance tests between Laravel's DB facade query builder and Laravel's Eloquent ORM. The DB facade was much faster than Eloquent

How many concurrent setTimeouts before performance issues?

I have a node.js app with 10k-100k concurrent setTimeouts running at any given time. (They are all 5 minute duration.) The callback is pretty trivial, just an H

How many concurrent setTimeouts before performance issues?

I have a node.js app with 10k-100k concurrent setTimeouts running at any given time. (They are all 5 minute duration.) The callback is pretty trivial, just an H

How to improve performance of JavaFX graphic drawing?

Situation : I've created an app which needs to draw simple rectangles (1x1 - 3x3 size) depends on some variables stored in array of corresponding size (900x900

Node+Express+MongoDB Native Client Performance issue

I am testing the performance of Node.js (ExpressJS/Fastify), Python (Flask) and Java (Spring Boot with webflux) with MongoDB. I hosted all these sample applicat

Does auto deduce the type at compile time or runtime in C++ 11?

Consider the following auto a = 10; When does the compiler know that a is an int, at compile time or at run-time? If it deduces the type at run-time, will it n

How to solve usng temporary;using filesort using MySQL SELET SELECT UNION SELECT

I have this query: SELECT * FROM (SELECT a.id AS id, a.user_id AS user_id, aa.power * a.amount AS total_power, a.group_number A

How to convert a nested for of loop into a custom iterator?

I have the following code: function* getPossibleCollidersWith(shape) { for (let square of retrieve(shape)) { for (let neighbor of square) { yield ne

MongoDB query optimizer keeps choosing the least efficient index for the query

I have a large collection (~20M records) with some moderate documents with ~20 indexed fields. All of those indexes are single field. This collection also has q

When using ASP.NET MVC, what is the best way to update multiple page sections with one HTML.Action() method?

I have a pretty big ASP.NET MVC site with 100 controllers and thousands of actions. Previously the header image that was defined on the Site.Master page was ha

timeit and its default_timer completely disagree

I benchmarked these two functions (they unzip pairs back into source lists, came from here): n = 10**7 a = list(range(n)) b = list(range(n)) pairs = list(zip(a,

Codewars execution timeout despite short execution time on other IDEs (Python)

I was solving a problem on CodeWars and my solution keeps getting execution timeouts. I know the code is correct and doesn't take long to execute, since when I

Docker running really slow on mac after PHP 7.4 > 8 update

We've recently updated our docker config from PHP7.4 to PHP8 running on Ubuntu 20.04. For most of the team this has been fine. For me and one other (both using

Android ViewPager and TabLayout are not working fast

There are nested fragments with TabLayout and ViewPager. Each fragment has listview inside it so they get call together and now I'm getting an issue of slow pro

Avoiding allocations but without allowing default zero values for value types

Value types in C# can't have a parameterless ctor, as the default behaviour for CLR when creating an instance without parameters is to just zero all the bits. A

Combining 2 Tables, Want to keep all Non 0 Bit on DUPLICATE KEY

I have a table with 1000 columns (yes its normalized), that is storing Biiig Daaata! I need to Insert Update new data as it becomes available overnight, and f

Can modern x86 implementations store-forward from more than one prior store?

In the case that a load overlaps two earlier stores (and the load is not fully contained in the oldest store), can modern Intel or AMD x86 implementations forwa

Why is a conditional move not vulnerable to Branch Prediction Failure?

After reading this post (answer on StackOverflow) (at the optimization section), I was wondering why conditional moves are not vulnerable for Branch Prediction

Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures?

I'm doing micro-optimization on a performance critical part of my code and came across the sequence of instructions (in AT&T syntax): add %rax, %rbx mov %r