Angular 1.x migration performance issues

I am upgrading a huge angular 1 project from 1.3.x to 1.6.x because we require some patches in the latest version. After updating it seems that the entire application has slowed dramatically. I have been looking through the migration documentation bu...
more »

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

Recurse through a dynamic array

I am looking for a generalised solution for the following snippet:: var d = [[1,2,3], [1,2], [1,2,3,4,5,6]]; d[0].map((val1, index1) => { d[1].map((val2, index2) => { d[2].map((val3, index3) => { console.lo...
more »

2017-03-15 16:03 (2) Answers

Django admin: view hangs on field_sets block

I have encountered a weird behaviour where one of the admin views which is quite simple and straight forward takes a while to load up until an nginx timeout in prod. Through Django debug toolbar and new relic I have found that the guilty code is the...
more »

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

Specify my own execution plan for query

Lets say I know a lot about the distribution of my data, and therefore know the optimal execution plan for a query. Is there a way to specify my own execution plan, fully circumventing table statistics and the optimizer? ...
more »

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

Best pratices for searching in unordered_map

I want to create a std::unordered_map < int, std::string > or std::unordered_map< std::string, int >. In this map I will store strings and their integer representations. I'll fill this map only in the code(hard coded pairs). I'll need co...
more »

2017-03-14 15: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

Concatenate Array in Java by Reference

I would like to concatenate an array in Java by reference like so. int[] a = new int[] {1,2,3}; int[] b = new int[] {4,5,6}; int[] ab = concatArrayByReference(a,b); //Function to be defined now if I do a[2] = 90; ab should be equal to {1,2,90,4...
more »

2017-03-12 17:03 (3) Answers

could sum be faster on lists

This is somehow a follow-up to this question So first, you'll notice that you cannot perform a sum on a list of strings to concatenate them, python tells you to use str.join instead, and that's good advice because no matter how you use + on strings,...
more »

2017-03-04 09:03 (3) Answers

Why is `std::array` slower than `std::vector`?

Note: This has only been confirmed in an online IDE, tests on my own laptop do not confirm this. Let us test the performance of the two containers with an almost same program, that is calculating the length of first 999999 Collatz sequences. I use s...
more »

2017-03-03 22:03 (0) Answers

Java method call performance

I have this piece of code doing Range Minimum Query. When t = 100000, i and j are always changed in each input line, its execution time in Java 8u60 is about 12 secs. for (int a0 = 0; a0 < t; a0++) { String line = reader.readLine(); Strin...
more »

2017-03-03 04:03 (5) Answers

Android - Storing 'large' data locally

TL;DR Would there be a way to store at least 23,000 records of data on app launch in an efficient manner for the user to be able to complete a form selection of this data in offline mode, if need be? Introduction I'm currently implementing an activ...
more »

2017-03-02 10:03 (2) Answers

Nav menu slider over ListView performs badly

I have written a JS application with a nav menu that slides into view using a simple CSS transition of the transform property. It performs well on Desktop browsers and Android. However, on iPhone5/iPhone6 there is a significant delay both before an...
more »

2017-02-27 03:02 (0) Answers