Data dodania Pytanie
2017-06-19 20:06 Saving the bits that are shifted off in a left-shift (SHL) »
Consider the following Intel 8086 Assembly program: CX holds non-zero value. L: ADD AX, AX ADC DX, 0 LOOP L I was asked to understand the ab...
(4) odpowiedzi
2017-06-19 15:06 Log parsing in Python: Alert if more than N errors in a given period? »
I have a log file that contains an hour's worth of data. I'd like to generate an alert if there are more than N errors recorded within any 5-minute p...
(2) odpowiedzi
2017-06-19 11:06 Efficient strategy to split database records into processed/unprocessed »
I often encounter this use case: I have a queue table with a high number (several millions) of records to process (synchronize with a remote API, ......
(1) odpowiedzi
2017-06-18 22:06 Increasing performance of a function which processes an array using destructuring and recursion »
I wanted to create a function which takes another function and an array as parameters and calls that function for each three consecutive elements of t...
(4) odpowiedzi
2017-06-18 21:06 How to Create a Pandas Index Faster? »
Why is the following snippet performing so badly: import numpy import pandas time = numpy.array(range(0, 1000000, 10), dtype = numpy.uint32) index =...
(2) odpowiedzi
2017-06-18 02:06 How to minify multiple HTML / CSS files at once? »
I know I can minify files and concatenate them one by one before production, but that sounds like a tedious way to do it. Is there some way to minify...
(1) odpowiedzi
2017-06-17 19:06 Why does max(iterable) perform much slower than an equivalent loop? »
I noticed a strange performance hit from a minor refactoring that replaced a loop with a call to the builtin max inside a recursive function. Here's ...
(2) odpowiedzi
2017-06-17 11:06 Python: The function trend to be slow »
I need to call a function in for loop. In the first about 200 iteration, the function cost about 0.2s each time. However, the function will cost about...
(0) odpowiedzi
2017-06-17 06:06 apache httpd high cpu 100% on centos 6.8 »
I'm using apache 2.2 on centos 6.8. Sometime some httpd process used 100% as image below: Top monitoring I already checked all website's source code...
(0) odpowiedzi
2017-06-16 18:06 Will fseek back to the previous location be faster than seeking to a new location? »
If I have a C code off_t off = ftello(f); fseeko(f, some_location); // do some work fseeko(off); Is the second fseeko as slow as the first one? I ...
(2) odpowiedzi
2017-06-16 09:06 What shall I use instead of OnMouseXXX event handlers? »
I've build a little app where I use OnMouseDrag and OnMouseDown in some objects. I thought that it would be the best option because this methods were ...
(1) odpowiedzi
2017-06-16 01:06 Vectorized version of finding the maximum positive value or else the minimum negative value »
Let's say I have a pandas DataFrame called purity_list as follows: In[]: purity_list Out[]: 48 49 50 2 0.1 0.9 0.3 A 0.2 -0.5 -...
(1) odpowiedzi
2017-06-15 14:06 Nested rolling sum in vector »
I am struggling to produce an efficient code to compute the vector result r result from an input vector v using this function. r(i) = \sum_{j=i}...
(2) odpowiedzi
2017-06-15 08:06 Python writelines() and write() huge time difference »
I was working on a script which reading a folder of files(each of size ranging from 20 MB to 100 MB), modifies some data in each line, and writes back...
(3) odpowiedzi
2017-06-15 02:06 What is the reasoning behind x64 having such a different performance result from x86? »
I was answering a question on Code Review and I discovered an interesting difference in performance (like, a lot) between x64 and x86. class Program ...
(2) odpowiedzi
2017-06-14 17:06 Bring Word2Vec models efficiently into Production Service »
This is kind of a long shot, but I am hoping that someone has been in a similar situation as I am looking for some advice how to efficiently bring a s...
(1) odpowiedzi
2017-06-14 13:06 How to design for higher scalability, in SQL Server databases that need set operations? »
Imagine a movie application that reommends the next movie to users based on this very simple algorithm: Movie should be new to user User has not mar...
(0) odpowiedzi
2017-06-14 10:06 Hash generation using java digest gets slower in time »
I'm having a real curious situation, in a production environment using wildfly 8.2 and Java 1.7. The situation is that when the server is been up fo...
(3) odpowiedzi
2017-06-13 15:06 Performance issue in spark java »
I am using spark 2.11 version and i am doing only 3 basic operations in my application: taking records from database: 2.2 million checking records f...
(1) odpowiedzi
2017-06-13 13:06 Comparing the speed of startswith() .vs. in() »
I was under the impression that startswith has to be faster than in for the simple reason that in has to do more checks (allows for the word being loo...
(3) odpowiedzi
2017-06-13 13:06 Fastest `finally` for C++ »
C++ so far (unfortunately) doesn't support finally clause for a try statement. This leads to speculations on how to release resources. After studying ...
(2) odpowiedzi
2017-06-13 01:06 Rails 4: why is one way of rendering partials so much faster? »
I'm not sure if this is a Rails specific issue, hence the reason I tagged it ruby as well. I'm rendering a collection of event records via a partial....
(1) odpowiedzi
2017-06-12 17:06 Why is processing an array for the second time slower? »
This simple C code first creates an array of 0xFFFFFF elements and then passes it two times, measuring how much time each pass takes: #include <ct...
(1) odpowiedzi
2017-06-12 11:06 Why the dip in speed increase for generating 400,000,000 random numbers? »
I'm generating around 400,000,000 (400 million) random numbers in parallel on an Intel i7 with 4 cores (8 threads hyperthreaded) on macOS with 8 GB RA...
(0) odpowiedzi
2017-06-12 04:06 Moving from Relational Database to Big Data »
Currently I have an application hosted on the Google Cloud Platform that offers web analytics and provides session activity (clicks, downloads etc) an...
(1) odpowiedzi
2017-06-11 20:06 Why is Arrays.copyOf 2 times faster than System.arraycopy for small arrays? »
I was recently playing with some benchmarks and found very interesting results that I can't explain right now. Here is the benchmark: @BenchmarkMode(...
(1) odpowiedzi
2017-06-11 19:06 Does using std::get on std::array give better performance? »
The Standard Library class template std::array<T, N> has both a member accessor function constexpr const T& operator[]( size_type n ) const...
(2) odpowiedzi
2017-06-11 03:06 Low performance in non-sequential iteration over int Array in JAVA »
I have the following function: public void scanText(char[] T){ int q=0; for(int i=0;i<T.length;i++){ q = transFunc[preCompRow[q]+T...
(1) odpowiedzi
2017-06-10 20:06 Pandas DataFrame slow to show shape or dtypes »
I'm very new to python and pandas. Any guidance, comment, and suggestion are appreciated! Here is my issue: it takes couple minutes to return the res...
(0) odpowiedzi
2017-06-10 17:06 c++ static lambda performance »
I stumbled upon this code that is using c++ lambda: qreal defaultDpiScale() { static qreal scale = []() { if (const QScreen *screen = QGu...
(1) odpowiedzi
2017-06-10 03:06 numpy.array(list) being slow »
So I have a list with 5,000,000 integers. And I want to cover the list to a numpy array. I tried following code: numpy.array( list ) But it is very...
(3) odpowiedzi
2017-06-09 23:06 Is it an optimization to explicitly initialize undefined object members in JavaScript, given knowledge of the innerworkings of V8/spidermonkey/chakra? »
In JavaScript, a commonly touted principle for good performance is to avoid changing the shape of an object. This makes me wonder, is this class Foo...
(1) odpowiedzi
2017-06-09 13:06 best practice to make a loop faster - is Multithreading an option? »
I call a Api Service with an index in the URL; for example the last index is: 420.555. I do this: for(int i =0; i <= 420555;i++){ url = new URl(...
(6) odpowiedzi
2017-06-09 02:06 Should I truncate my ints to shorts before computing bitwise ops on them? »
Suppose I have a bitwise expression f: int -> int that is dependent only on the two lowest bytes of the input. In general, would it be any faster t...
(3) odpowiedzi
2017-06-08 22:06 javascript optimization for pair finding algorithm »
I am working on a javascript function which takes an array of integers and a target as arguments. The task is to find the first pair of integers in th...
(2) odpowiedzi