As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [performance]

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

43 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
1k views

Why does clock() function in C from <time.h> header only returns clock ticks in increments of 10's of thousands?

I am curious to know why does the function clock() only returns values in increments of 10,000 and is not able to return values in between. I have the following code: #include<iostream> #...
yoyo_fun's user avatar
  • 2,267
4 votes
0 answers
105 views

Design synchronous wrapper around async process

I'm building a Spring-Boot API that will serve a system that requires synchronous behavior despite the API doing async operations. I'm not too familiar with threads and I'm thinking this might be the ...
Joe Essey's user avatar
  • 191
4 votes
0 answers
91 views

Truncating HTML content at specific content blocks

I have HTML content in my DB and I would like to present a list of these individual items but truncate each of them so they're not fully displayed. I would like to keep truncated items human-...
Robert Koritnik's user avatar
4 votes
1 answer
321 views

Caching data in a Rails variable instead of querying the database?

I have a list of about 15000 items in my database, every one of them has a unique ID and name. New items are added regularly but usually not more than ten a day. My frontend uses a form with ...
krebas's user avatar
  • 49
3 votes
0 answers
140 views

Possible to find intersections between a line segment and a disjoint set in log2(n)?

Given a set S of disjoint 2D line segments, is there a way to pre-process S into a data structure that can check if a single arbitrary segment L intersects any segment in S in log2(n) time, as well as ...
Aeris130's user avatar
3 votes
0 answers
540 views

Maximising data processing speed: in-memory or write to db first?

Currently working on a system which allows users to upload data files, which we then "clean" (i.e. process in various ways). Speed of processing and return to the user is an important consideration, ...
Bob Tway's user avatar
  • 3,576
2 votes
0 answers
142 views

Speed up implementation of "log transform" on 2D image

I'm working on an implementation of the "log transform" operator on an image for C++, and we currently have it formulated as follows (python code). Note we use log10 instead of the natural ...
kwsp's user avatar
  • 129
1 vote
1 answer
516 views

C++: Broadcast/observer pattern with polymorphic events

I'm currently trying to implement an event-system following a broadcast/observer scheme. I have events/notifications that contain information about what is happening: class Event { public: Event(...
TheBeautifulOrc's user avatar
1 vote
0 answers
49 views

Stuck on approach on how to serve a lot of data to users with a lot of possible combinations

So, I'm making an application which monitors specific things that happen within the area of a user. And I'm really stuck at the approach on how to serve specific real-time data to my users. I am using ...
Thimma's user avatar
  • 119
1 vote
0 answers
153 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 ...
NeiL's user avatar
  • 111
1 vote
0 answers
626 views

How to Investigate the difference between query execution times?

I have a simple query, when executed directly in SQL Developer Studio (It's an Oracle Database) takes around 4 seconds. But when executed via my Java code it takes around 20 seconds. I'm using ...
Can't Tell's user avatar
  • 1,121
1 vote
0 answers
188 views

Location specific caching for read-heavy data (server architecture)

This project will serve many duplicate requests with location-specific answers. I.e. 10,000 people in New York will all get the same server response (a list of businesses in New York), but one person ...
Matthew's user avatar
  • 11
1 vote
0 answers
450 views

Is BoneCP + JDBC a good alternative to JPA/Hibernate?

To some extent, I don't have a problem with JPA which inevitably needs an implementation such as Hibernate. However, it requires configuration and ORM. I don't specifically like using Hibernate ...
Mohamed Ennahdi El Idrissi's user avatar
1 vote
0 answers
291 views

Binary tree pruning

I have a generic binary tree which is used for calculating combinations of things - i.e. a powerset in set parlance. Most of the time it is used for calculating subsets of size N. As a real world ...
Robbie Dee's user avatar
  • 9,717
1 vote
1 answer
222 views

Optimal Simplification of Transposition Products

I am looking to take a product of a large number of transpositions, and boil it down to a smaller number of products. I have the following code, and would like some input on efficient ways to boil ...
Santana Afton's user avatar
1 vote
0 answers
377 views

Guaranteed message sending for messages of different priority for different modules

We have created a message que system using priority messages. The idea behind this is as follows: We have a list of clients. All clients know if (and what kind of priority) messages they have ...
Vincent's user avatar
  • 365
1 vote
0 answers
138 views

Distributed Design to Speed Up Video Processing

Currently I have one web server running Django, which takes a series of images from a user, uploads them to an Amazon S3 bucket, and finally calls an Amazon Lambda instance, which runs a python script ...
John Dorian's user avatar
1 vote
0 answers
446 views

Reading large files for ETL program POC

I'm looking for some information on how to increase the performance of reading large text files for use in an ETL process. We're currently using a proprietary program that is more of a scripting ...
user1426158's user avatar
1 vote
0 answers
97 views

Efficient Copy While Sorting

I have an algorithms library called NDex. I am in the process of upgrading it to a new version. Part of this upgrade involves providing two versions of many algorithms: an in-place version and a ...
Travis Parks's user avatar
  • 2,495
1 vote
1 answer
2k views

System Design: Chat Application and Polling

What would be the best way to add chat feature to an android, ios, and web app? Is polling really as bad as people say? The requirements are user to user messaging and chat rooms. Here is my thought ...
user2370642's user avatar
0 votes
0 answers
41 views

Is CQRS applicable with total ordered views and sharding?

Merry Christmas everybody. I am trying to solve a theoretical sharding problem out of my own curiosity and I think CQRS can help me achieve properties that I want of my data. I have too much data for ...
Samuel Squire's user avatar
0 votes
0 answers
100 views

Avoiding reloading entities many times with EF Core and Mediatr

We have a largeish .NET Core project which uses Mediatr and EF Core. Many of the queries look something like: public class GetSomeInformation : IRequest<string> { public int DocumentId { get;...
Lou's user avatar
  • 265
0 votes
0 answers
60 views

Do datacenters have conditions that might throttle component clock speed (either intentionally or automatically)?

Here is the question. On a 2.2 GHz processor with 6 physical threads and 6 hyperthreads, I see performance on the order of 3-10s for a particular job involving OpenCV. I do not specify that the ...
Chris's user avatar
  • 109
0 votes
0 answers
213 views

Improving performance of 'Weighted/prioritized left shuffle algorithm'

I wrote a prioritized/weighted left shuffle algorithm (the code is copied from my open source C# project Fluent Random Picker). What does that mean? You've got some values and each of them has a ...
ndsvw's user avatar
  • 101
0 votes
0 answers
33 views

A large number unused wakelocks and performance

There is an application that every day creates about 100-200 new wakelocks for android. each wakelock is used once and after using it is no longer needed, but remains in the system. Thus there are a ...
Filin's user avatar
  • 9
0 votes
0 answers
85 views

Handle big data sets in a web application in combination with real-time communication between web-clients

We have the following use case to be developing: A web application that shows a data table / data grid with up to 100000 rows and 30-50 columns. Each column is filterable and sortable. The web ...
OPunktSchmidt's user avatar
0 votes
0 answers
223 views

How can you multithread an html parser [ in C++ and similar languages ]?

Ive done two HTML parsers. Done with Regular Expressions [that accounted for nesting]. It was quick, but error prone. Done by evaluating Character by Character through switches. Here was the basic ...
Anon's user avatar
  • 3,545
0 votes
0 answers
412 views

Implement multiple file upload with Dropzone.js , Lambda and S3

This is more a general question about this project I have on. We need to implement some UI for our costumers to upload multiple files (2000+) every month, so we can send them by email to another ...
jspasiuk's user avatar
0 votes
0 answers
76 views

Most performant way to store and find overlap in (coordinate, id, time interval) triples

Let me explain what I'm doing. I have a grid based on integer coordinates like (5,5), (5,6) etc., and I have an algorithm FindCells that generates a list of (coordinate, interval) tuples. These ...
sollniss's user avatar
  • 109
0 votes
0 answers
513 views

DDD: aggregate root and references to child entities

I'm struggling a bit to grasp all DDD concepts and apply them to a real project. Let's say I have the following domain concepts: Car: a vehicle moving inside an area Path: a journey made by a car, ...
Alessandro's user avatar
0 votes
0 answers
60 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"....
Laurent S.'s user avatar
0 votes
0 answers
305 views

Best way to reduce memory consumption on persisting Java objects

Let's say I have an application that maintains relationships between objects - think of a parent-child relationship tree. The lineage of these objects are critical, so maintaining references from ...
user0000001's user avatar
0 votes
1 answer
3k views

Two way data synchronization between web application and REST API server

I have a web application and a REST API server (Microsoft Dynamics CRM 2016) that I don't have access to it's code, but I have access to the available resources. I need to create a data sync between ...
M.Abulsoud's user avatar
0 votes
0 answers
113 views

AngularJS: cost of deep watching infrequently changed object trees

I am working on a complex widget with a "preferences" object tree with 50-100 objects and 3-5 properties in each object. Each property is watched by Angular and controls how some aspects of the data ...
billc.cn's user avatar
  • 620
0 votes
0 answers
132 views

Best datastructure to use

I am using Amazon's dynamodb nosql database and as a result I need to think of some ways to do certain operations to fit into their limits (e.g 4k item limit, can't combine small items into the same ...
user2924127's user avatar
0 votes
0 answers
80 views

Cost of cache coherency/sharing data across multiple cores?

If I have two CPU cores, one is writing a particular cache line and the other core wishes to Read Write the same cache line, what are the costs (in cycles) for doing so? I am a little unsure ...
user997112's user avatar
  • 1,441
0 votes
0 answers
477 views

BCMath vs MySQL: performance

Scenario I am working on a web application that handles financial transactions, and my code will need to be reusable for everything from consumer carts to manufacturer/distributor shipments. The ...
Jonathan Voss's user avatar
0 votes
0 answers
33 views

Where to generate View?

I plan to build a CRM for small companies. It is supposed to be a single-page application. Now I am unsure where it is more efficient to convert the data to HTML. Should I rather do it on the server ...
Knerd's user avatar
  • 614
0 votes
0 answers
965 views

Writing Z80 table based assembler/disassembler

I have a long-term project: DIY computer with various processors. One of my wishes not only make hardware, but software too. So I started from assembler/disassembler for Linux, though there is a lot ...
pugnator's user avatar
  • 101
-1 votes
0 answers
7 views

String iteration algorithms performance in jQuery Terminal

I have a JavaScript library jQuery Terminal and I have internal formatting that is used to change colors and style of the text that look like this: [[b;red;green]this is bold red text with green ...
jcubic's user avatar
  • 135
-1 votes
1 answer
72 views

Operational planning for web app (backend)

I know the question is a bit broad, but will give it a try. I newly joined a backend team in our company that is about to release an app to external users, I noticed we don't have an operational plan,...
a.u.r's user avatar
  • 107
-1 votes
1 answer
39 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 ...
Cindy LB's user avatar
-5 votes
1 answer
94 views

Strategy for delivering static pages in a web application

Sometimes in Single Page Applications (SPAs) there are pages like Welcome, About, Help or Support which are just static content and which doesn't require frameworks like Angular. I often see that ...
CodeYogi's user avatar
  • 2,146