Questions tagged [performance]

For questions pertaining to the measurement or improvement of code and application efficiency.

0
votes
0answers
10 views

Pygame slows for no apparent reason

I have a python script that resizes images and displays them. After a while (time varies), the program slows to a crawl and I don't know why: the system has not run out of ram or thermal throttling ...
0
votes
2answers
76 views

Why Rust is faster than Ocaml in Performance, Even though first Rust compiler was implemented in Ocaml

I found that the initial compiler for Rust language was written in Ocaml. So what i thought was that Rust would be similar to Ocaml performance wise. But when I look at benchmarks Ocaml vs C++ and ...
0
votes
0answers
8 views

How to calculate perplexity for topic models LSA, PLSA, CTM? how to implement PLSA and CTM?

unable to find inbuilt package for computing perplexity for LSA model. Also unable to implement CTM code in python. looked at david blei's repository already
0
votes
2answers
26 views

How to speed up this word-tuple finding algorithm?

I am trying to create a simple model to predict the next word in a sentence. I have a big .txt file that contains sentences seperated by '\n'. I also have a vocabulary file which lists every unique ...
1
vote
1answer
53 views

Are ternary operations carried out at compile-time?

I am making a bitboard-based chess engine from scratch in C. The move generation procedure is particularly time-sensitive. Currently, my code is like this: void generate_moves(Position *p, Colour ...
0
votes
0answers
10 views

Slow Cors Check - Asp.net Core 2.2

I have an asp.net core 2.2 api that I am sending ajax requests through axios in a reactjs app. I am finding that it can take seconds for the cors check to happen(204 status). In fact it can take ...
1
vote
0answers
23 views

Vectorize a for loop over pandas ewm function

So I want to vectorize a for loop to speed things up. my code is the following: import numpy as np import pandas as pd def my_func(array, n): return pd.Series(array).ewm(span = n, min_periods = ...
0
votes
0answers
14 views

Sympy module is Running very Slow

Given a list of lengths and a point (x,y), I would like to find if a circle centered around (a,b) with radius 25 intersects any lines. The lines are all centered around the point (x,y), has a length ...
1
vote
1answer
23 views

PIXI.js performance optimizations for large number of interactive circles

I'm new to Pixi and was considering leveraging it to make a data visualization with a boatload of data points and labels. To experiment / get started, I created a quick app that renders a 100 random ...
2
votes
1answer
40 views

What is most efficient way to create new activity

If i have a submenu which has three option: Create New,Update ,Manage data . what would be the best way ? create new activity for all these? create fragments? or send intent message after menu item is ...
0
votes
3answers
34 views

How to count matches between a vector and dataframe of sequence coordinates?

Given a data table with start and end coordinates for sequences of integers: set.seed(1) df1 <- data.table( START = c(seq(1, 10000000, 10), seq(1, 10000000, 10), seq(1, 10000000, 10)), END = ...
0
votes
0answers
5 views

“Go to sheet” button/sheets slow down the performance on Tableau Server

I'm publishing my workbook to Tableau Server. I'm faced to long loading times. I noticed that this is due to the "go to sheet" button or sheets. I published two same sheets, except one with "go to ...
0
votes
1answer
24 views

WebView rendering with MathJax very slow

I am passing an HTML string containing Tex-formatted math to a WebView, which uses the MathJax library (delivered through a CDN) to render the webpage. The problem is, the app takes a long time to ...
0
votes
1answer
15 views

p4python vs. calling p4 using subprocess, which way performs better?

As title. I noticed that calling p4 from the subprocess module is not very fast. But I hesitate learning the Perforce Python binding without knowing whether or not it performs better. I'd ...
-1
votes
0answers
22 views

How to implement stop order in a trading platform? [on hold]

I'm working on a trading platform. Now I need to implement the stop loss order functionality Description: Suppose that market price for BTC/USD is 7900 at the moment and you have 4 BTC in your ...
0
votes
0answers
19 views

Efficiency in for ..next loops of storing array element as variable versus keeping array element

Question: Is it more efficient to store kmatch(c) in e and use e? Please explain why for answers. Background: While looking for time savings for code to run, the above question came to mind for code ...
0
votes
1answer
18 views

Does slicing an array using Index/Range create a copy of the array

With C# 8.0 seeing the introduction of the structs Index and Range we can now easily get a slice of an array doing something like string[] baseArray = {"a","b", "c", "d", "e", "f"}; var arr = ...
0
votes
0answers
19 views

Taking picture with Android Camera intent is very slow

In my android App I'm allowing the user to take a picture and save the full size image to the internal storage of the device. I'm using the Camera intent. protected void takePhoto() { Intent ...
23
votes
5answers
2k views

Why is a `for` loop so much faster to count True values?

I recently answered a question on a sister site which asked for a function that counts all even digits of a number. One of the other answers contained two functions (which turned out to be the fastest,...
0
votes
0answers
28 views

How do I load a large dataset into Python from MS SQL Server?

Setup: I have a pre-processed dataset on an MS SQL Server that is about 500.000.000 rows and 20 columns, where one is a rather long text column (varchar(1300)), which amounts to about 35gb data space ...
0
votes
0answers
27 views

Does Normalization,Standardization or Centering effects the Model Performance?

I know that there are many benefits of Normalization,Standardization or Centering of Predictor variables (Read many post on this) but confused on how it effects - 1) RMSE value 2) Predictions (Does ...
-5
votes
0answers
32 views

Erlang passing connection object in function argument raised CPU Usage?

I am new to Erlang, not have much idea about its internal calls. What I have to do is to read couch document and passed the day as request body to another server through API call. So I have passed ...
1
vote
0answers
22 views

Is hardcoded object properties in the angular template perform better in browser when compared to having a pipe to read value

I am working on an Angular project which contains 24 modules and due to customer requirements, there are always changes to the code. We have 2 approaches in hand Using the object with keys directly ...
2
votes
1answer
30 views

Is it faster to apply multiple indexes to a table one after the other or with multiple individual queries

This is not about multiple column indexes (composite) vs single column indexes. This is about performance more so than function. I have a scenario where I need to apply multiple indexes to the same ...
0
votes
0answers
10 views

WCF - Stress Test - Slow Perfomance

We had a problem with our WCF endpoint performance, so we did a stress test to get more information regarding this. Our environment: LOAD BALANCER; 4 HOSTS(4vCPUS and 4Gb RAM) each; Application ...
0
votes
0answers
21 views

What in my implementation of the Bowyer-Watson algorithm is making it O(n^2) or worse instead of O(n log n) like it's supposed to?

I've recently finished implementing the Bowyer-Watson algorithm for calculating Delaunay triangulations in the plane in Javascript. The Wikipedia article (https://en.wikipedia.org/wiki/Bowyer%E2%80%...
1
vote
0answers
20 views

Is this a bad idea: using lambda to streamline gated logging

I am considering this: At top of class private static final Logger LOG = Logger.getLogger(MyClass.class.getName()); // A little lambda to streamline gated logging. private static final BiConsumer&...
2
votes
1answer
40 views

SQL cross match IDs to create new cross-platform ID -> how to optimize

I have a Redshift table with two columns which shows which ID's are connected, that is, belonging to the same person. I would like to make a mapping (extra column) with a unique person ID using SQL. ...
-2
votes
0answers
30 views

Buggy and very slow collision system for RubyDung decompilation in Java using LWJGL 2.9.3 [on hold]

My problem So, I decided to decompile the code of Minecraft's first version, "rd-132211". This game was called RubyDung (Minecraft's technical name in first versions). Here's a screenshot of this ...
-2
votes
0answers
9 views

Speed of opening netbeans while laptop is charging is slower than is not charging

I have a new laptop with ssd installed to store all my files. I also stored my netbeans inside this ssd in my laptop. I dont know why when I am not charging, when I open netbeans it took me like 3 to ...
0
votes
0answers
22 views

MongoDB - Cloning multiple documents with small changes

I'm using Mongo DB via the Mongo DB C# driver. I have a collection with many documents, where each document has an ID and a version. The documents are quite heavy. I have a scenario where I need to ...
0
votes
0answers
26 views

Tensorflow.dataset sliding window pipeline performance

I'm implementing tf.data input pipeline for time-series classification problem; dataset itself is a >2M time-ordered record of 50 features; for any given time t prediction model ingests k-sized window ...
0
votes
0answers
5 views

iOS devices with 120 Hz - what is the UIKit refresh rate

In most tutorials or recommendations a value of 60 fps is listed as the ultimate refresh rate for the app to aim for. I.e. if the app is able to consistently provide the user experience at 60 fps ...
1
vote
0answers
16 views

How to keep major-order when copying or groupby-ing a pandas DataFrame?

How can I use or manipulate (monkey-patch) pandas in order, to keep always the same major-order on the resulting object for copy and groupby aggregations? I use pandas.DataFrame as datastructure ...
2
votes
2answers
73 views

400 threads in 20 processes outperform 400 threads in 4 processes while performing a CPU-bound task on 4 CPUs

This question is very similar to 400 threads in 20 processes outperform 400 threads in 4 processes while performing an I/O-bound task. The only difference is that the linked question is about an I/O-...
-1
votes
2answers
63 views

How can you make this python code using for loops run faster? [duplicate]

Can anyone give me some advice on making this long python code using for loops run faster? This is a code to find 3 integers in a list called "nums" that is closest to "target". This code totally ...
0
votes
0answers
9 views

Long TTFB on apache with nginx as reverse proxy

I have a big problem with my dedicated server. In practice apache has a really slow response on the first time I open a website, byte check give me a wait of 5-19sec. I tuned the server (apache, ...
0
votes
0answers
12 views

How do I enable TTL-Cache control on my site?

I tried google pageSpeed to check the possibilities to enhance the performance of my REACT site(create through CRA). The analytics show that I need to Serve static assets with an efficient cache ...
0
votes
1answer
47 views

R: Speed up for loop containing which

I have two data frames - one contains a bunch of postcodes and surveys allocated to them (df1), the other contains all possible postcodes and the zones within which these are contained (df2). I ...
0
votes
0answers
21 views

SQLite speed in Android studio

I have a table, less than 100 rows, 5 attributes. At an activity, there are 4 tabs by fragment. In each fragment, I call the following code at 'onCreateView'. When I change the tab to another tab, ...
3
votes
1answer
67 views

400 threads in 20 processes outperform 400 threads in 4 processes while performing an I/O-bound task

Experimental Code Here is the experimental code that can launch a specified number of worker processes and then launch a specified number of worker threads within each process and perform the task of ...
0
votes
1answer
10 views

Conditional formatting in Cognos and performance

I have added conditional formatting to a Cognos report, and it seems to have slowed down The report was running okay before I added the formatting, and I have not changed anything else on the report, ...
0
votes
0answers
21 views

How to reduce complexity in inner loop using hashmap

I have written python code to get index where sum of two elements in array is equal to 11 like in below python code. arr = [4, 6, 8, 10, 4, 1, 3, 5] for i in range(0, len(arr)): for j in range(...
0
votes
0answers
55 views

How to speed up a Rcpp double for loop

Since I am not an expert in C++ (or Rcpp) I was wondering if there are other / better ways to write this little function below, which uses 2 for loops to fill up a matrix based on the values of 2 ...
1
vote
1answer
52 views

Optimizing SQL query from derived table

I have the following SQL query select s.channel_id, count(1) as unique_views from ( select m.channel_id from view_statistics vs inner join medias m on m.id = vs.media_id group by m....
7
votes
2answers
166 views

Is it faster to sort an array or use a heap while inserting

I have a constant stream of numbers that I am generating that I will later need to iterate over. Is it more efficient to add them to an array then use std::sort() or to add them to a heap(priority ...
0
votes
0answers
9 views

Implication of calling mixed content on Mobile App

I have a mobile app and using HTTPS for all calls which is good. I am also calling CDN images with HTTPS. I am thinking to switch to calling CDN image with HTTP to save because it's less processing ...
-3
votes
0answers
18 views

How to improve performance in python + sql server [on hold]

to put everybody in context, i'm a beginer - intermediate python programmer and I'm currently developing a personal project, working with python and sql server. The application is a desktop app ...
0
votes
0answers
24 views

Angular Mat-Table slow performance with expandable rows

I'm facing the problem mentioned on the title. I have a mat table datasource with expandable rows declared in a child component that receives as @Input() an array of users and a variable for Status ...
0
votes
0answers
16 views

Bad performance on live fuzzy search

I've created a Web API using .NET Core and I'm currently struggling with an endpoint which return a top list of similar customer addresses related to an customer address as an input. In short: I've ...

http://mssss.yulina-kosm.ru