Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [performance]

Performance is a subset of Optimization: performance is the goal when you want the execution time of your program or routine to be optimal.

0
votes
0answers
17 views

Deferred Iteration in TypeScript

I've published a new TypeScript library currently in beta, and was hoping to get feedback on certain aspects of it, particularly implementation details for improving the performance of deferred ...
1
vote
0answers
34 views

Script that finds and replaces strings

I needed to do a script that finds and replace strings. The script will take a JSON config file that tells it which word to find and replace. This is what I did. I would like to know if there is a ...
0
votes
0answers
29 views

Allocating caller information to a specific source

My current code takes a set of caller information (calldataFile or CD_) and allocates it back to the specific source that it ...
0
votes
2answers
38 views

Speed up sorting algorithm in R: make one column “smaller” than the other

Consider the following sorting algorithm: ...
1
vote
1answer
18 views

Character pattern replacement using gsub, loops, and data.table

I was trying to see if data.table could speed up a gsub pattern matching function over a list. Data for reprex. It's a list of ...
3
votes
0answers
37 views

Testing application stability by throwing random diagnostic exceptions

I'd like to be able to better test application stability. Usually when you're doing this, you run the application and keep your fingers crossed that it won't crash when an error occurs (be it a ...
4
votes
1answer
48 views

Check if we can form a word across words in a sentence

I've come across a simple challenge: given a phrase, check if we can form the given word vertically by stacking words in rows. For example, we can form the word ...
3
votes
4answers
55 views

A queue implemented using an array

We've just finished learning about queues in my data structures class; I want to make sure I really understand it. I'm still feeling a bit lost on how to optimize the data use of a queue. I've ...
1
vote
2answers
35 views

Stitching together badly formatted log files

I needed to stitch together a large number of badly formatted log files. I [painfully] developed a script for it in R, one that successfully dealt with the various flaws in the dataset. However, this ...
0
votes
1answer
14 views

JS counter in DOM

I've written a function to update the contents of an HTML element to display a counter. On pageload the counter will recieve an initial value, every five minutes the new value will be requested from ...
-1
votes
0answers
24 views

SQL code takes too much processing time

I have the following code ...
2
votes
1answer
26 views

Plain Page Flip Effect

I've created a very plain version of page flip onscroll. I made it to look like turning the pages of a book. It looks OK on browsers I have (Firefox 52.9, Chrome 49, IE8). Though the effect doesn't ...
10
votes
2answers
158 views

Determining if a string can be permuted to a palindrome

I am going through Elements of Programming Interview by Aziz, Lee and Prakash one of the questions is how to determine if a string can be permuted to a palindrome. For example ...
1
vote
1answer
65 views

JSON serialization object with huge IEnumerable

This code is looping over polygons geometries vertices in order to create a list of deltas (distance) between vertices coordinates to compact the geometry before sending it into the web. Geometry ...
2
votes
1answer
36 views

O(n) Object Pool

I recently rewrote my object pool design to \$O(n)\$ complexity. I did this using a linked list, which is not native in JavaScript. It does not, unfortunately, automatically assign ...
0
votes
0answers
38 views

Comparing 100,000 string pairs, quickly [on hold]

I recently compared various comparison operators in ColdFusion 2016 ...
1
vote
2answers
109 views

Bubble and Cocktail sort

Lately, I've been developing sorting algorithms as a kind of exercise to make better code and I've come accross something curious, even though bubble and cocktail sort are known to perform horribly, I ...
2
votes
2answers
461 views

Processing voice samples

I'm within an audio application that sends variable-length buffers to my DLL, which will process at higher speed (48000 samples per sec, but can also be higher). Here's the code I've written: ...
0
votes
0answers
25 views

Frontend Code Challenge - Calculating Permutations

I prepared the following code for a job interview in the last few months. Unfortunately the interviewer would not provide feedback on the code itself. I'd like to get some community feedback to ensure ...
-3
votes
0answers
18 views

Need views on my coding style, readability and efficiency [closed]

https://github.com/MihirLuthra/C-programs-for-clg/blob/master/QueueImplementationByLinkedList.c simple implementation of queue using linked list in C suggestions welcomed for improvising my coding ...
2
votes
1answer
49 views

Product and Factor

Overview I was challenged recently to write some code that could find the smallest integer that when multiplied and divided by 2 or 3, retained all of its digits and gained no extras. For example: ...
6
votes
0answers
92 views
+50

Speeding up Buddhabrot calculation in PyCuda

I've just started using PyCuda with Python 3, but I have some experience in high performance computing on CPU. I've tried to port one of my old models for generating the Buddhabrot to run on my GPU ...
0
votes
1answer
23 views

Image to HTML / CSS conversion using pure JS

Just for fun I wrote some JavaScript that "converts" an image into pure HTML / CSS. The user is able to select a local image. This image is loaded into an invisible canvas in order to extract ...
4
votes
1answer
130 views

Convert boolean list to list of base10 integers

Context: I'm coding up a simple genetic optimization algorithm from first principles, and have decided to use boolean/binary strings as genes so that I can flip bits on or off as a form of mutation. ...
-3
votes
0answers
16 views

Effiicient implementation of A* [closed]

Does anyone know where I can find a fairly efficient implementation of A* for Java? Searching doesn't prove fruitful as search engines ignore or treat the * as a special character which makes ...
1
vote
2answers
73 views

Prime factorization program

Compute the prime factors of a given natural number. A prime number is only evenly divisible by itself and 1. Note that 1 is not a prime number. My solution will catch every prime up to and including ...
1
vote
2answers
112 views

Performance of generic VS non-generic method (array generating function)

I'm trying to improve performance for a generic function that turns a string into a multidimensional array. Expected input: A string that was generated by the function ...
-1
votes
0answers
52 views

SQL Server Express 2017 INSERT SELECT Performance Issue [closed]

The current problem description is as follows: I have uploaded two files on OneDrive. File 1: "script.zip"(1.5 MB) Link is: https://1drv.ms/u/s!AuV9gXqFVffxhEQgLpnrQ79O0cf8 File 2: "...
0
votes
0answers
40 views

Creating a table with parallel arrays

In my snippet below I've created a simple table using flat arrays, the main reason they're flat is for a slight (hopefully) performance boost since my actual data will be around 5000-10000 rows of ...
0
votes
0answers
24 views

Python: Shared Nearest Neighbor (SNN) Clustering Algorithm

I wrote my own Shared Nearest Neighbor(SNN) clustering algorithm, according to the original paper. Essentially, I get the nearest neighbors for each data point, precompute the distance matrix with ...
3
votes
1answer
52 views

Vectorizing matrix operation instead of for loop in circular matrices

I have a vector \$X_k\$ and a matrix \$Y_{k,j}\$, where \$k \in \{1,\dots,K\}\$ and \$j \in \{1, \dots, J\}\$. They are circular, meaning that $$\eqalign{X_{k+K} &= X_k \\ Y_{k+K,j} &= Y_{k,j} ...
0
votes
1answer
41 views

Creating dynamic table rows

I would like to know how to make this faster. It's okay for 100 rows but 1k, 10k, 100k is different. ...
9
votes
4answers
1k views

Program that finds the longest word not containing one of the disallowed characters

Problem definition Find the longest word that doesn't contain any of the following characters: gkmqvwxz Input comes from a file named ...
1
vote
1answer
47 views

Search dictionary for matching values

I have a dictionary self.indexList = {} filled with 3-item-lists values = [lineId, nominalLineId, vertex] for each dictionary ...
2
votes
0answers
60 views

Longest Palindromic Substring challenge

My code is a mix-up between dynamic programming with the HashMap and brute force with the way I reach out the results and substring. I don't know how to optimize my ...
3
votes
2answers
57 views

Sieve of Eratosthenes in Rust

This is a relatively simple implementation of the Sieve of Eratosthenes in Rust. The main objective is to find the \$n\$th prime quickly when \$n\$ might grow to huge numbers. ...
8
votes
2answers
101 views

Where is the most desolate place in Colorado?

The Story While flying a plane over the forests of Wisconsin a couple years ago, I thought to myself "If I lost an engine, I would be awfully long way from an emergency landing airport. I wonder ...
1
vote
1answer
54 views

Median of two sorted arrays JavaScript

Trying to find the median of two sorted arrays in O(log(m+n)) or better. I believe this is O(log(m+n) or O(log(m)) or O(n). ...
1
vote
1answer
77 views

Inserting data into SQL-Server table dynamically

I know I can do all this via SSMA quite quickly, but I wanted to see if I could do it efficiently in PowerShell myself as a little project. Basically, the entire script takes tables from an Access ...
2
votes
1answer
56 views

2D Matrix with jagged array isn't faster than one with a multidimensional array

I was trying to use Math.Net's dense matrix class. But, it doesn't support int. So, I have to create a wrapper for a jagged 2d array. I knew that jagged arrays ...
0
votes
0answers
4 views

Generating a playlist from a media collection based on date

This checks my media collection for the current date and generates a playlist to launch. The code is solid but there would be a great need for speed since I have around 27.000 files and it takes a few ...
1
vote
1answer
103 views

Efficiently sample a single row of an array at random

I have the following C++ code snippet that randomly samples a single row in an array called pop with num_specs columns and ...
1
vote
1answer
45 views

Optimizing loop - Reducing native calls

I am developing Android-Disassembler. I need to optimize the loop below. It is currectly calling native method for each instructions(about 4 bytes). So this loop will be looped about millions of ...
-2
votes
1answer
41 views

Using Reflection to call multiple methods and cast various classes [closed]

I have written the following Reflection code: ...
1
vote
0answers
29 views

Ruby - Create a bitmap editor that accepts user input to plot a matrix grid, points and lines

I recently didn't pass a take-home code test for a job interview - and one of the reasons for this was that the code was not as idiomatic as it could be. The premise is in the title - but below ...
5
votes
2answers
78 views

Encoding and decoding log entries in a Lossy Binary Format

One of the projects I'm working on requires logging a huge amount of information (basically, every function call). The problem is obviously that logging a lot of information has a few side-effects, ...
1
vote
2answers
75 views

Function in Javascript takes too long, why? [closed]

The program we are working at has the following function: ...
2
votes
2answers
52 views

Method that receives a hexadecimal string and returns a formatted matrix of those values

This method is part of a larger project and comes after encoding ascii characters into hexadecimal values, so it assumes the parameter is always a valid hex string. ...
1
vote
2answers
55 views

Check if a string is a valid english word, and convert to a valid english word

This is an interview question. For the purpose of the question, a valid English word is a string that begins with an uppercase English letter, and the rest of the string contains only lowercase ...
1
vote
0answers
38 views