Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [performance]

Questions related to improving application performance, this can be range from selection software architecture to selection of algorithms.

-1
votes
0answers
26 views

Does replacing Heap Memory access with Distributed In-Memory Cache(Memcache or Redis) scale in Micro-services? [on hold]

One of the reasons why Micro-services are popular is because they are stateless.However an application needs to maintain state obviously . The question comes down to What is the most efficient way ...
2
votes
1answer
143 views

Would de-coupling using interfaces/templates make the system easier to maintain at the cost of over-engineering?

I have been practicing this hybrid approach for dependency injection in the last couple of days and I am wondering if it should also apply to components which are within the same package? For example:...
12
votes
3answers
2k views

Working through the single responsibility principle (SRP) in Python when calls are expensive

Some base points: Python method calls are "expensive" due to its interpreted nature. In theory, if your code is simple enough, breaking down Python code has negative impact besides readability and ...
-2
votes
0answers
26 views

Chrome Task Manager tab memory footprint VS OS Task Manager Chrome memory usage

I'm profiling my website's performance when having a large amount of data to support. Memory usage is one of the measurement I care about. I checked Chrome Task Manager, my website's memory footprint ...
1
vote
1answer
49 views

How to implement a partial resource rest api?

I first posted this question on stackoverflow but I think, it as more it's place here. In order to limit the size of my REST API answers, I want to implement the Google performance tip: using the ...
1
vote
2answers
200 views

How are “registers” implemented in VMs?

Process VMs (such as the Oracle JVM, CPython, .NET CLR etc.) are usually stack-based or register-based. Are the "registers" in a register-based VM actually the registers of the underlying physical ...
0
votes
0answers
41 views

Zipping and downloading multiple files

We're currently designing an web application that will basically expose "messages" to end users, each message consisting of a subject and body, but more important 1 to many files we call "attachments"....
0
votes
2answers
125 views

Does chaining higher order functions mean worse performance?

For clarification, let's review the following example: Consider that we have the following array of Ints: let array = [1, 2, 3, 4, 5] and we've been asked to generate a new array from array ...
2
votes
3answers
195 views

Comparison of build times on various hardware; why non-linear results?

Why do the compile times not vary significantly between different era CPUs, even though disk (NVMe vs. HDD) and CPU benchmarks vary significantly in performance? Why does disabling hyperthreading ...
1
vote
2answers
203 views

Splitting a critical application into multiple executables

We're developing some C++ application that analyses strings using some data. The data is large (a few gigabytes) and takes a significant amount of time to load into memory, and timing, as well as ...
1
vote
1answer
42 views

Efficient and readable method for styling of javascript webcomponents

I have a web page that loads a very long list of custom web components, each with their own shadow DOM and a stylesheet shared by all instances. Originally, I included the stylesheet as css file ...
1
vote
1answer
95 views

Best practice with SignalR communication

I'm working on a project that involves online purchases. I have my web api in C# and my client in REACT (javascript). Server and client are connected with SignalR. I want that when an ORDER is ...
0
votes
1answer
140 views

Efficiency in Java: Object reference vs id reference

I have to represent a certain data structure, in which I have nodes that are related between them. Each node has its numeric id, and a list containing the next directly related nodes and another list ...
3
votes
3answers
241 views

In c++, is there a way inside a function block, to execute cleanup code after the value has been returned?

Backstory (You can skip) I am building an API for managing Files and Directories in a consistent manner across a project. This is for deduplication and consistency when performing a task, and in this ...
2
votes
4answers
192 views

Using Instance or Static Method for reusable method

I have made a lot of forms for my desktop application, some forms were using the same method which I have to copy and paste the code (not OOP). Let's say I have a method called FirstDayOfWeek() and ...
2
votes
3answers
218 views

What's faster.. Multiple variables or single array? [duplicate]

I have a C-coded function that realizes a very long calculation on a microcontroller. I try to optimize it for speed at the moment. The function content is created automatically using Mathematica. It ...
0
votes
1answer
55 views

Storing session data on client or server side

I have an Android application that communicates with the server using REST. During the flow, the client(Android) usually send 3 separate requests to the server with different data. Some of the data ...
-2
votes
1answer
21 views

Filtering the Data and summing on one field Should I do in JAVA or write query with aggregate query with filter clause?

I have one table in which there would be millions of records. The requirement is to the records based on the condition and then total on one of the fields. Selectivity would be around approx 50. ...
0
votes
1answer
38 views

Design decision for a cross-platform text editor that optimized for speed

On designing a cross-platform text editor that optimized for speed - I heard atom.io uses node.js, would it be slow? I heard sublime text uses C++, would it lots of effort to be cross platform and ...
0
votes
3answers
104 views

Should I reuse a predicate for multiple IEnumerable checks

In a long running Windows Service I have a custom thread pool manager that has a loop which continuously looks through a couple lists for idle threads. Given multiple uses of the same predicate, is ...
-4
votes
2answers
155 views

Performance question - what are the defects of high level programming languages and compilers that makes assembly still a better choice today [closed]

What I want to know is, how can we still make use of assembly today, in productive manners? When assembly outperform C, so it would seem practical to write a section of the project in assembly rather ...
1
vote
0answers
45 views

User level customised activity feed design

I am working creating api for activity feed of user. Feed contains different type of entities. Before that let me give you bit overview about the app. Its a video app where Users can ask questions ...
1
vote
2answers
117 views

When using an ORM when should I sacrifice performance for convenience?

I work with SQL Alchemy a lot and, as a "lazy programmer", I enjoy the convenience it offers. But the "diligent programmer" in me often worries about optimisation and the performance of the queries ...
13
votes
7answers
738 views

Saving high-frequency events to a connection-limit constrained database

We've got a situation where I have to deal with a massive influx of events coming in to our server, at about 1000 events per second, on average (peak could be ~2000). The problem Our system is ...
106
votes
15answers
14k views

When to optimize for memory vs performance speed for a method?

I recently interviewed at Amazon. During a coding session, the interviewer asked why I declared a variable in a method. I explained my process and he challenged me to solve the same problem with fewer ...
0
votes
1answer
109 views

Security and performance considerations when creating chat system on a Flask backend

I am building a website with the Flask framework. One functionality of the site will be that users can send messages to each other. I created a prototype of this using Flask WTF forms. The basic ...
1
vote
2answers
202 views

How to benchmark software performance under same conditions (RAM, CPU caching etc)?

I am writing a software that splits big files into smaller files and I have coded several solutions. I am measuring the execution time of each of my solutions. (with threads, go routines, MPI etc) ...
1
vote
1answer
151 views

When is creating a supplier for an object less expensive than creating the object itself?

Objects contains 2 method overloads where one takes an object and the other takes a Supplier of that object: public static <T> T requireNonNull​(T obj, String message) public static <T> T ...
2
votes
1answer
87 views

If you can store BigInts in a more optimal way than an array

This suggests just storing BigInts as an array: // n = -123 var n = { sign: -1, digits: [3, 2, 1] }; However, if you have "big ints", that array will get large: var n = { sign: -1, ...
2
votes
0answers
69 views

Performance: Creating duplicate file

I have a Web server (Local) and File server(Remote). I need to create a duplicate of an xml file in the same location with different file name in the File server. The size of the file is random, but ...
0
votes
1answer
54 views

Better to store miscellaneous metadata in database or calculate on each access

I have a number of attributes I need for various page loads and other backend tasks, and I'm debating on whether storing these things in a database or calculating them on the fly. For instance, if ...
0
votes
1answer
73 views

Logic circuit simulation: homebrew or third party solution?

Software I'm working on requires simulation of logic circuits, both combination and sequential. Now the simulation doesn't need to be too detailed, in fact it could be detrimental to the function of ...
1
vote
3answers
58 views

Calculating Journey Summary made by a vehicle and Cache them to database

This is more of a point me in the right direction kind of question, I have 2 solutions but both of them are invalid because the data calculated is invalid in some scenarios. I am working on a system ...
0
votes
1answer
119 views

Simple but frequently throwing vs reasonable but rarely throwing vs complex but never throwing [duplicate]

A lot of code that's designed to convert or parse some data of type Foo into a Bar is written with the assumption that one wouldn't intentionally pass it invalid inputs. As such, it assumes that ...
7
votes
2answers
585 views

How did heavy software in the early days managed to run on 4MB RAM computer? [duplicate]

It's no secret that in the early days of computers, they had only 1-4MB of RAM. I found an article stating you needed only 4MB of RAM to run Word, Excel and PowerPoint simultaneously. How was that ...
3
votes
2answers
4k views

Why should I use foreign keys in database? [closed]

In my 10+ years of experience in the IT field, I have never used foreign keys in any of my project and I never felt the need. I did work with professional databases which had foreign keys constraints. ...
2
votes
2answers
689 views

How do I avoid increased memory consumption by browser and performance degradation when dealing with many records?

In my MVC 5 web application there are many instances in which users will require to view thousands of records within grids, now I managed to get around many performance related issues by utilising the ...
3
votes
4answers
304 views

High Performance Garbage Collection

I am new to garbage collection but have been looking around. I have noticed that Reference Counting has a very bad reputation (PHP, Python), as well as Conservative GC (Ruby) under certain conditions. ...
1
vote
1answer
291 views

Would Cython-like “Cypescript” be a feasible idea?

Cython is a superset of Python that can be complied into C modules that can be imported and used normally in Python code. This can be used to speed up parts of a Python program. In a recent project, I ...
-1
votes
1answer
31 views

Tolerated Performance when generating a document from SQL

Is it acceptable for a framework to generate an XLS document of more than 300k rows and 6 columns in 2 minutes? This framework took 2 minutes to generate the document while fetching data from a local ...
3
votes
1answer
630 views

ToList() vs Using default list constructor

After reading rules of Clean Code, one of them is to use default constructor when using transferring data from one collection to other. For example i have : Dictionary<string, string> dict = ...
3
votes
1answer
352 views

Are design principles of functional programming languages and current hardware (register-machines) contrary?

Functional languages seek to minimize accidental state (computationally-convenient but logically unnecessary data dependencies) by endorsing the most granularly modular, mathematically unambiguous ...
0
votes
1answer
401 views

How to load test Publisher/Subscribing queue?

I am trying to load test a queue that works on a pub sub pattern and can't figure out how response time is to be calculate and the TPS(transactions per second). Problem statement : The pub sub ...
2
votes
1answer
147 views

Is it a good idea to release an application with custom performance counters?

I have been reading on C# Performance Counters and I was wondering if I should be keeping them in my release build? I have never encountered an application that has it's own custom performance ...
-1
votes
1answer
25 views

Cursor select on 2nd Primary key on db2 sql field for embedded positional value - Unable to determine most efficient for longterm design

I have a SQL DB2 table where the first two fields are the primary keys (not including the third field which is date/time stamp). The table was designed by another team with the intent to make it ...
-2
votes
1answer
132 views

Avoiding multiple calls to SQL and persist data

I often received messages objects and for each of them I need to query the database in order to achieve some additional information from one database table. Since we are performing many requests to ...
0
votes
2answers
145 views

Exponential Growth of Scope of C++ Projects

I've been coding in C++ professionally for six odd years, and it's my go-to language for performance-critical projects. When working to a deadline, the scope expands to fill the time available. ...
0
votes
4answers
182 views

Improvements in java based test framework to reduce execution time

Let me give a bit of background on the problem. We have a java application which has MQ integration and an Integration Test pack which is also written in java. The test pack runs all scenarios (...
2
votes
1answer
995 views

Why is one way data flow (eg. React, Vue, Angular) faster than two way data binding with dirty checking?

I understand that two way data binding can be expensive and slow. For example, imagine a toy grocery list app that lets you list grocery items and their prices, and shows you the sum of the prices (...
10
votes
3answers
1k views

Reasons behind non-intuitive C# String.Split() implementation

In C# if I want to split a string by another string I have to do something like that : testString.Split(new string[] { "anotherString" }, StringSplitOptions.None); From the overloaded String.Split ...