Questions tagged [performance]

36972 questions
1

votes
1

answer
409

Views

Handling huge ajax response with javascript

I'm building a site that uses jQuery File Tree. Sometimes the AJAX response from the server is huge: 900 KB, 70000 'files' (I'm not really displaying files). Of course displaying this puts a lot of strain on javascript (client side) and it happens that the browser freezes because of that. What would...
user2583501
1

votes
2

answer
61

Views

How to avoid doing two separate passes while querying through a table?

The context of this problem are hospital visits. The logic is a bit convoluted but these are the requirements. Table Visits contains the names and visitIDs for the patients. Table FilteredVisits contains certain visits that meet some criteria The report is run under a certain date range - this is im...
Gabe
1

votes
2

answer
1.4k

Views

vba replace nested if statement

Is there a way to make this more efficient? I find it a bit ugly. I want to verity if there is a next "deck", if so, execute some for it, until deck8 here is my code: If deckNum > 0 Then 'Execute code for deck 1 If deckNum > 1 Then 'Execute code for deck 2 If deckNum > 2 Then 'Execute code for deck...
user2895741
7

votes
1

answer
52

Views

Why is fancy assignment slower than fancy lookup?

I'm currently trying to get a better understanding of memory related performance issues. I read somewhere that memory locality is more important for reading than for writing, because in the former case the CPU has to actually wait for the data whereas in the latter case it can just ship them out and...
Paul Panzer
1

votes
1

answer
225

Views

what is the -J-XX meaning? appear in the java command line

I found in the java command line, there is the parameter like " -J-XX:ThreadStackSize=256 -J-verbosegc", i know the -XX but how about the -J ? anyone knows? Thanks
user2939990
1

votes
1

answer
878

Views

Most Performant Android ViewGroup to Use For Independantly Positioned Children? - RelativeLayout vs FrameLayout

I'm no Android expert but I am aware of discussions regarding the appropriate use of LinearLayout and RelativeLayout, keeping the view hierarchy as small as possible, avoid unnecessary passes of onMeasure(), etc. Lets imagine I have two ImageView's that I want to position completely INDEPENDENTLY,...
Oliver Pearmain
1

votes
5

answer
609

Views

Strange slow queries with MySQL

I have table A which contains IP ranges (columns startIpNum, endIpNum, locId) and table A_location (column locaId and other not important columns). There are following indexes - startIpNum and endIpNum on A, and locId on A_location. The problem is that sometimes queries are performed very slowly. Be...
1

votes
1

answer
657

Views

Node.js fs.readFile vs jQuery $.getJSON - which is faster?

I'm working on a program running in Node-Webkit, and I use jQuery for many other tasks. Now I have a settings.json file that I need to load upon the start of the program, and I was thinking about how to load it. So either I use the node.js fs functions to read the data from the file and then use JS...
woubuc
0

votes
0

answer
3

Views

Log4j Memory/performance issue while rolling file

In my project I am using log4j and I am rolling files once in a day. RAM size is 8GB. When the file is being rolled, the API which is hosted on that machine, becomes non-responsive for good 3-4 minutes.After the log file is rolled, the API starts responding after some time. The Memory usage is very...
user2306856
1

votes
1

answer
137

Views

measure cuda execution time with respect to number of blocks

I wrote my first cuda script and wonder about how it is parallelized. I have some variables r0_dev and f_dev, arrays of length (*fnum_dev) * 3 each. On each block, they are read sequentially. Then there are r_dev, which I read, and v_dev which I want to write at in parallel, both are arrays of lengt...
spiehr
1

votes
1

answer
276

Views

In vs regular expressions for checking against a word blacklist — estimating expected production performance

I have many HTML pages in which I need to check the existence of blacklisted words. I know that the built-in in is much faster then regular expressions but here I'm trying to compare many in against a single regular expression. Since re.match() checks for a match only at the beginning of the string...
1

votes
5

answer
200

Views

Javascript array 100000 x 100000 - kill my browser

I'm trying to construct such array ( Matrix ): var arr = []; var matrix_size = 100000; var start_time = Math.round(new Date().getTime()) / 1000.0; for( var i = 0; i < matrix_size ; i++ ) { var row = []; for( var j = 0; j < matrix_size; j++ ) { row.push( 0 ); } arr.push( row ); if ( counter % 10 == 0...
user299448
1

votes
2

answer
98

Views

Matlab vectorization of for loops

Is there any way to vectorize such a for loop in MATLAB? It's taking a lot of time to execute. for i = 1:numberOfFrames-1 frameDifferencesEroded(:,:,i+1) = imabsdiff(frameDifferencesErodedTemp(:,:,i+1),frameDifferencesErodedTemp(:,:,1)); for k=1:numel(frameDifferences(1,:,i)) for m=1:numel(frameDiff...
baris_ercan
1

votes
2

answer
25

Views

Merge K sorted arrays of Length N

This is the problem as stated in the book: Suppose you are given K sorted arrays each with n elements, and you want to combine them into a single array of kn elements. You use the following approach: first merge the first and second arrays, then merge the resulting array with the third array, then t...
DCS
4

votes
1

answer
98

Views

Angular Animation Performance State/Transition vs Query

I am currently taking a deeper dive onto angular animations, and I couldn't figure out if there can be a recommendation in relation to performance at how to attach the animation to elements/components 1. State/Transition .html .ts trigger('animation_foo', [ state('true', style({...}), state('false',...
Jonathan Stellwag
4

votes
2

answer
157

Views

How to get test initialize in memory and use in each test

I'm trying to create Unit Test. I have class User: public class User { public int UsersCount { get { using (MainContext context = new MainContext()) { return context.Users.Count(); } } } public Guid Id { get; set; } = Guid.NewGuid(); public string UserName { get; set; } public string Password { get;...
DIlshod
1

votes
1

answer
379

Views

Caching an advanced search query in rails

I have this method in my model that powers the search function in my app: def self.get_products(cat_ids, term, min_price, max_price, sort_column, sort_direction, current_store = nil) products = Product.where(category_id: cat_ids).joins('LEFT JOIN stores ON stores.id = products.store_id') products =...
Skyalchemist
1

votes
1

answer
1k

Views

Comparison of Avl Tree and Red Black Tree

I have an exam tomorrow and there are 3 questions those i can not understand on my notes. 1- #searches >> #insertions and #deletions=0 Which tree is that? (Avl or Red-Black Tree) (Answer is Avl) 2- #insertions>0 and #searches=#deletions=0 Which tree is that? (Avl or Red-Black Tree) (Answer is Red...
Uğur
1

votes
1

answer
4.4k

Views

Drop index query is slow

This is the query I'm trying to execute: DROP INDEX id_index on table; I've been able to drop indexes quickly in the past, but this query ran for almost an hour before I gave up on it. What could be causing this slow pace?
Garrett
1

votes
2

answer
133

Views

How much perf can I get using half_floats for vertex attribs?

Currently I have a dynamic VBO (updated every frame, particle system). I send 4 floats for pos and 4 floats for color. How much perf can I expect if I move to half_float data type? Is it something like 5% or maybe 30%? Lets assume I want to send 100k...500k particles, in point sprites. So I send aro...
fen
0

votes
2

answer
46

Views

Java performance : Java logic to find the 3 highest number from huge list [duplicate]

This question already has an answer here: Find the k largest elements in order 6 answers This was the question I was asked in an interview for checking the performance knowledge. Question - I have a list (Arraylist by default and if you wanna change the list then justify) of integers. There are mil...
DarkKnight
1

votes
1

answer
522

Views

Extending Object.prototype breaks JavaScript for..in loops, which are used heavily in Google Maps API v3

I am developing project in meteor. I need to find object key form object value. So I tried the below code, But browser freezed. Object.prototype.getKeyByValue = function( value ) { for( var prop in this ) { if( this.hasOwnProperty( prop ) ) { if( this[ prop ] === value ) return prop; } } } var test...
1

votes
1

answer
225

Views

Unsafe, reflection access vs toCharArray (performance)

JDK9 team puts effort into helping us removing non-public dependencies (using jdeps). I am using Unsafe class for faster access to Strings inner char array - without creating new char array. If I want to drop dependency on Unsafe class, I would need to load it dynamically and call Unsafe.getObject a...
igr
1

votes
4

answer
48

Views

Appropriate location to load/call javascript in HTML

I observed that there is a generic behavior to declare the javascript within head tag of HTML followed by the body and rest of the content. This is mostly practiced when we have jQuery or any other library files that we want to refer in our project, Why do we need to add the javascript in the head t...
Shreyas Patil
1

votes
1

answer
418

Views

does a compound index in MongoDB improve multified match (not sorting)?

The documentation seems a bit unclear on that. 1)It clearly states that compound indexes DO improve performance of multi-field SORTING (order and direction dependant). 2) There is one phrase which makes me think it will also improve multi field MACH (sql analogy: where a=1 and b=2 and c
user1312695
0

votes
2

answer
47

Views

Why do I have performance issues when using List.IndexOf(List.Where()) inside of a loop?

I am working on a solution for getting a list of bigrams and the count of each bigram, for a given input. The performance was poor with large input; execution time took about 42 seconds for input of 460,000 characters and 84,000 words. I changed the code and it’s performing fine now, but I am not...
KRob
1

votes
1

answer
51

Views

Kafka message timestamps for request/response

I am building a performance monitoring tool which works in a cluster with Kafka topics. For example, I am monitoring two topics: request, response. I.e. I need to have two timestamps - one from request and another from response. Then I could calculate difference to see how much time spent in a servi...
kan
2

votes
3

answer
76

Views

Do Static Variables Impede Data Caching?

From Optimizing Software in C++ (Section 7.1), The advantage of static data is that it can be initialized to desired values before the program starts. The disadvantage is that the memory space is occupied throughout the whole program execution, even if the variable is only used in a small part of th...
okovko
-1

votes
1

answer
45

Views

Python: Very slow nested for loop

I have approx. 266680 users (the value of my user_num variable is 266680) and a map with user index key and business index list values. For example: users_businesses[0] = 1,5,7,9,11,15 means that the user with index 0 has already voted the businesses with 1,5,7,9,11,15 index. My task is to create ed...
B.J
1

votes
2

answer
112

Views

PostgreSQL performance testing - precautions?

I have some performance tests for an index structure on some data. I will be comparing 2 indexes side-by-side (still not decided if I will be using 2 VMs). I require results to be as neutral as possible of course, so I have these kinds of questions which I would appreciate any input about... How can...
Zeruno
-2

votes
0

answer
19

Views

How to optimize javascript website speed(too many javascript files)

I have created my website in HTML, css, javascript and nodejs. On frontend their are atleast 20 js files, which i am including. But i don't know, why my website speed is too slow to load. It takes atleast 20-25 seconds to load. I want to load it in max 5-6 seconds. This is my website url: www.tappet...
test
-2

votes
0

answer
9

Views

SQLiteException: no such column: firstname (code 1):

I'm working with databases and I have the following DbHelper class. and I am the beginner in SQLite database public class DbHelper extends SQLiteOpenHelper { private static final int DATABASE_VERSION = 1; private static final String CREATE_TABLE = "CREATE TABLE "+DbContract.TABLE_NAME +"("+DbContrac...
rahul
1

votes
2

answer
679

Views

MySQL Database with Multiple Servers

Basically, I'm working on a REST API for my application. I was researching for server performance, and I couldn't find information on splitting a database. Would it be better to have a single file system shared through multiple servers that use MySQL (if it's possible to store it on a shared file sy...
T Lavi
1

votes
4

answer
2.2k

Views

Performance of H2O predict() function

I'm using H2O's Random Forest Regression model in python. While evaluating its performance in terms of speed, I've compared it to scikit-learn's RandomForestRegressor. The dataset consists of ~20,000 rows and 20 columns of data. My machine runs windows with python 3.6 on it. import time import h2o i...
TomP
1

votes
2

answer
674

Views

How to delay my each thread group in JMeter (without using startup delay)

Here I have 4 Thread Groups present in my Test Plan and I have a requirement, need to run test plan in the time interval of 30 minutes between each of my Thread Group (2nd thread group should start only after 30 minutes, after the completion of 1st thread group and so on). But cannot estimate the ac...
PRAKASH RAMANATHAN
11

votes
1

answer
4.7k

Views

Can Google.com and other heavily trafficked websites get a “fast” rank using Google's PSI v5 API?

Does using the 90-percentile instead of median score when saying, "based on field data the 'page is slow'" make it impossible for heavily trafficked websites, such as google.com, from ever getting ranked "Fast"? This due to the long tail that occurs when monthly traffic is in the 10M+ ranges? Last t...
adamrights
4

votes
1

answer
54

Views

Will a Python list ever shrink? (with pop() operations)

I have been using .pop() and .append() extensively for Leetcode-style programming problems, especially in cases where you have to accumulate palindromes, subsets, permutations, etc. Would I get a substantial performance gain from migrating to using a fixed size list instead? My concern is that inter...
Brent Allard
0

votes
0

answer
6

Views

Ways of speeding up graph database with new resources

I am running neo4j on DigitalOcean. Unfortunately I am running very complex queries that after all of the possible optimizations (Memory allocation increase, query optimization) are still not fast enough for the app I am developing to be useful for the end user. What are other ways - actual resource...
Nikita Vlasenko
1

votes
0

answer
12

Views

Loading images from Firebase is extremely slow

When i migrated all my image-files from inside the application to Firebase then the performance changed alot. Loading the images from the Firebase takes too long and it is not because of my internet (i have 200/200mb down/up speed). Im also using the Glide library to resize my huge images. This is h...
Delice
1

votes
1

answer
52

Views

libsvm compiled with AVX vs no AVX

I compiled a libsvm benchmarking app which does svm_predict() 100 times on the same image using the same model. The libsvm is compiled statically (MSVC 2017) by directly including svm.cpp and svm.h in my project. EDIT: adding benchmark details for (int i = 0; i < counter; i++) { std::chrono::high_r...
user1934513

View additional questions