Facebook comments loads very slow

Facebook comments component load same JavaScripts many times and slows our page with 1.2+seconds sometimes load for 29sec Please help. the script is in the bottom of the HTML source, we get it from Facebook developer API http://www.247polls.com/...
more »

2017-03-25 18:03 (0) Answers

How to store numpy objects ( matrices ) fast?

I have to store a list of numpy matrices. Two approaches I tried: 1.Create a list and append to it: ls_ws=[] for ind in range(iterations): ... ls_ws.append(ls_w) # ls_w is a matrix of size 6,1 Problem: Fast at start, gets very slow at end...
more »

2017-03-25 13:03 (2) Answers

Code optimality

Every time I'm coding I have dilemma between creating more variables and using methods, that make code more clear but less optimal? Can you tell me what is better for our application performance? For example: protected static <T> void exch(Li...
more »

2017-03-20 00:03 (2) Answers

Asp.net Partial Bussines Logic Class

I have many classes on my application like Profile.cs, Post.Cs , Product.Cs and for database operations dbopertations.cs and businesslogic.cs For example (for one method) dboperations.cs inlcudes ` ` public static List<Post> GetPost() {...
more »

2017-03-18 17:03 (1) Answers

Why the first time memory copy runs is slow?

What I found: I print the time cost of golang's copy, and it shows the first time of memory copy is slow. But the second time is much faster even I run "copy" on different memory address. Here is my test codes: func TestCopyLoop1x32M(t *testing.T)...
more »

2017-03-17 17:03 (1) Answers

What is the cost of mmaping on Mac OS X?

I have an algorithm where my life would be greatly simplified if I could reserve about 20 blocks of memory addresses of size 4GB. In practice, I never use more than 4GB, but I do not know which block will fill up in advance. If I mmap 20 blocks of 4...
more »

2017-03-17 14:03 (1) Answers

Performance of Prime Testing with Haskell

I have two ways of testing for primes. One of them called isPrime and the other is isBigPrime. What I originally wanted is to test "big" primes with "small" primes that I have already computed, so that the testing becomes faster. Here are my implemen...
more »

2017-03-16 20:03 (1) Answers

How to keep cache in wordpress after logout

I have a wordpress with woffice theme installed and WP Super Cache, only authenticated users can have access. The problem is the webpage is too slow, when visiting any template without cache last about 7 seconds The server is a VPS with 16GB ram an...
more »

2017-03-15 17:03 (0) Answers

Removing reverse duplicate rows R

I have a data.table with two columns of genes and each row treated as a pair. Some gene pairs are duplicated with the order reversed. I am looking for a faster method, preferably without using a loop like the one I've provided, to keep unique pairs i...
more »

2017-03-15 07:03 (1) Answers

Cross product all points in 3D space

I have a vector, a, which I wish to cross with every point in a defined 3D space. import numpy as np # Grid x = np.arange(-4,4,0.1) y = np.arange(-4,4,0.1) z = np.arange(-4,4,0.1) a = [1,0,0] result = [[] for i in range(3)] for j in range(len(x...
more »

2017-03-14 14:03 (2) Answers

newInstance vs new in jdk-9/jdk-8 and jmh

I've seen a lot of threads here that compare and try to answer which is faster: newInstance or new operator. Looking at the source code, it would seem that newInstance should be much slower, I mean it does so many security checks and uses reflection...
more »

2017-03-14 13:03 (2) Answers

Object cache - Good practice?

I have this idea to increase performance and I would be happy to get your opinion on whether this is good practice or not ? Let's imagine I have "movie" objects that are rather expensive to build. Now, let's say I have a view that displays 3 lists of...
more »

2017-03-13 11:03 (0) Answers