performance

Fast algorithms for finding unique sets in two very long sequences of text

I need to compare the DNA sequences of X and Y chromosomes, and find patterns (composed of around 50-75 base pairs) that are unique to the Y chromosome. Note that these sequence parts can repeat in the chromosome. This needs to be done quickly (BLAST takes 47 days, need a few hours or less). Are there any algorithms or programs in partic...

Performance GROUP_CONCAT on MySQL

Hi, i was trying to optimize some queries on my MySql Db when i found myself in a doubt. The problem: two similar queries produce almost the same result but the one I tought would be more expensive it isn´t, Having this table: CREATE TABLE `da_video_votes` ( `video_id` int(10) NOT NULL, `user_id` int(10) NOT NULL, `type` enum('l...

Expain the result of "explain" query in mysql

I am using indexing for mysql tables. My query was like this EXPLAIN SELECT * FROM `logs` WHERE userId =288 AND dateTime BETWEEN '2010-08-01' AND '2010-08-27' I have indexing on field userId for this table logs, and the result of explain query is like below. id select_type table type possible_keys key key_len r...

why there's a difference of performance gain among both these queries?

SELECT instmax, r FROM (SELECT instmax, rownum r FROM ( SELECT instmax FROM pswlinstmax ORDER BY instmax DESC NULLS LAST ) WHERE rownum <= 10 ) WHERE r >=6; Output SELECT instmax, r FROM (SELECT instmax, rownum r FROM ( SELECT instmax FROM psw...

c3p0 loop and OSGi

I wrap my project in OSGi bundle(just call my first start method from Activator.start()). In my project I use ORM ActiveObjects and c3p0 pool. All of project dependencies (jar librarys) are in class path. If I run my project with c3p0 it is takes about 5 minutes to 1 query to DB. Without c3p0 it is works correctly. In what is a problem? ...

Fastest character replace in string

Need to replace a char from another string. $s1='123456789'; $s2='abcdefghi'; $p=4; // position of char in $s1 to use for replacing (0 is first char) $s2 = ???? ; // code In the end $s2 must be 'abcd5fghi' What would be fastest method? ...

Performance of Occurences of Substring in String

Hey, I came across the task to find all occurences of a substring in another string and was wondering what will be the best algorithm to solve this problem. For demonstration purposes I used the string "The cat sat on the mat" and search for all occurences of the substring "at". This should ultimately result in an occurence count of 3....

JDBC & MySQL read performance

Hey, I really seem to have a big problem here. I'm using MySQL to store part-of-speech tagged sentences in a table. The Table looks like this: +------------+------------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +------------+------------------+------+-----+---------+-------+...

Merits of Bash Script v. Python Script for Shell-Command-Heavy Utility

I need to write a script to do the following: Monitor a queuing system, which is accessible by shell commands. Create directories from templates using a mix of inline text editing, cp/mv, command line scripts, and compiled c++ programs. Check for error conditions. Write files on error conditions. Note: 2D arrays would be mildly usefu...

How to index collection by using composite key

I have this class public class Item { public int UniqueKey; public int Key1; public int Key2; public int Key3; public int Key4; public string Value; } and the collection IEnumerable<Item> I want to create indexes on items of this collection by Key1, or by Key2, or composite one (Key1 and Key4). The number of ...

How to reverse the order in a FOR loop

I've a simple FOR statement like this: var num = 10, reverse = false; for(i=0;i<num;i++){ console.log(i); } when reverse is false I want it to return something like [0,1,2,3,4,5,6,7,8,9] but, when reverse is true, it should return [9,8,7,6,5,4,3,2,1,0] Which is the most efficient way to get this result, without checking eve...

IIS 7 Extremely slow for .aspx pages

I'm running IIS7 on Server 2008 (R1). When I run a completely blank .aspx page, the page still takes more than one second to load, even after compiling and refreshing the browser several times. A non-aspx file, i.e. image or css file takes about 200ms. I've even timed it from the BeginRequest event to the EndRequest event, which rep...

How to write caller location information in a log file using Java, without hurting performance?

Hi folks. How can I write caller location information (Java source file and line), in a log file using Java and log4j, but without hurting performance? log4j allow you to write such information in the log file, but it uses the stack trace to get that it information, every time a log statement is issued, what causes performance degradatio...

Performance profiling Windows Phone 7 apps (SL/XNA)

Is there performance profiler for Windows Phone 7 (SL/XNA)? I just want to measure execution time of calling methods. ...

Whats a good java debugger?

I'm trying to find memory leaks and performance issues with my java application. Is there a program out there that can help me debug my application and display performance results? Thanks. ...

Overhead of exception handling in D

In the D2 programming language, what are the performance implications of using exception handling? In particular: What if I write no exception handling code? What if I do, but no exceptions are ever thrown? What if I do, and exception are thrown? Does exception handling cause any optimization opportunities to be missed? Can exception h...

Does using a PHP framework affect performance?

If I used Code Igniter or the Cake Framework, will it affect the performance of my application? ...

Python import X or from X import Y? (performance)

I'm just wondering - if there is a library from which I'm going to use at least 2 methods, is there any difference in performance or ram usage between: from X import method1, method2 and this import X I know about namespaces and stuff, but I'm just wondering if python is smart enough to know that I'll use only 2 methods. ...

CMS and high traffic sites : PHP and MySQL

Hi; Is there any difference between CMS and hight traffic websites (like news portals) in logic and database design and optimization (PHP and MySQL)? I have searched for php site scalability in stackoverflow and memcached is in a majority. Is there techniques for MySQL optimization? (Im looking for a book for this issue. I have searched...

When fine tuning performance, what is the best way to call Javascript methods multiple times?

Hello, I have been researching Javascript performance. I've learned that when accessing more than once, it is usually best to copy closure variables and class members into local scope to speed things up. For example: var i = 100; var doSomething = function () { var localI = i; // do something with localI a bunch of times v...