Query with multiple joins and optional parameters

I have something of a Search App. There are 7 fields (first name, last name, phone, street, city, shop number, credit card number) where user can write parameters and it's gonna find him clients in the database. Everything is working with AND conditi...
more »

2017-01-12 21:01 (2) Answers

Why is Collections.counter so slow?

I'm trying to solve a Rosalind basic problem of counting nucleotides in a given sequence, and returning the results in a list. (For those ones not familiar with bioinformatics it's just counting the number of occurences of 4 different characters ('A'...
more »

2017-01-11 16:01 (2) Answers

Efficient async filter

I have a computationally heavy section of code which performs filtering of a data-set by DOM-manipulations. I made it async in order to ensure acceptable performace for large number of fiter items: .on('input', function { setTimeout(function(){ ...
more »

2017-01-08 22:01 (1) Answers

Speed up Pandas cummin/cummax

Pandas cummin and cummax functions seem to be really slow for my use case with many groups. How can I speed them up? Update import pandas as pd import numpy as np from collections import defaultdict def cummax(g, v): df1 = pd.DataFrame(g, col...
more »

2017-01-07 21:01 (2) Answers

Java List Horrible Adding Performance

I'm adding millions of entries of a custom object to a List. This turns out to be very slow and the graphical user interface keeps freezing randomly as well (not responding on Windows) even though the adding operation is wrapped in a SwingWorker so i...
more »

2016-12-31 21:12 (1) Answers

A heavy query to mongodb hangs the website

My website (using MEAN.JS) has 1 login page, and it has also multiple statistical pages (reporting pages built on data in db). There is 1 heavy report which would draw ~100MB out of database, and take ~10s to complete. The problem is when running th...
more »

2016-12-28 10:12 (2) Answers

Why tuples are not enumerable in Elixir?

I need an efficient structure for array of thousands of elements of the same type with ability to do random access. While list is most efficient on iteration and prepending, it is too slow on random access, so it does not fit my needs. Map works be...
more »

2016-12-26 17:12 (2) Answers

numpy ufuncs speed vs for loop speed

I've read a lot "avoid for loops with numpy". So, I tried. I was using this code (simplified version). Some auxiliary data: In[1]: import numpy as np resolution = 1000 # this parameter varies tim = np.lin...
more »

2016-12-26 01:12 (1) Answers