473,511 Members | 16,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Program slowing down with greater memory use


I have two different python programs that are slowing down quite a bit as
their memory use goes up.

I'm not really sure if this is some sort of CPU cache effect, or if it's
something about python's garbage collector taking more time, or what.

One of the programs is one of those "how fast is data moving through the
pipe" measurement tools, called reblock. I'd initially expected that the
program would run faster with large block sizes, because then you're
wasting less time with in the C library, system call interface and context
switches.

But that turned out to be false. If I use a blocksize of about 2**18, it
runs much faster than if I use a blocksize of 2**22.

Then another program, which is a search engine, will slow way down if I
try to run it against too many search keywords. The program inhales a
bunch of filenames at the beginning, and if I run it against n files, n>m,
and later run it against m files, then the n file run will be quite a bit
slower even after it has handled only m files. The program implements a
memory cache to speed database operations, but even when the size of my
cache is nowhere near the size of the system's physical memory, it still
slows way down in this enigmatic way.

This makes me wonder.

What's the deal here? Is the garbage collector working overtime on these
programs that have a lot of objects? One of the programs above (reblock)
doesn't precisely have a large number of objects - just one huge string.

Thanks!

Jun 22 '06 #1
3 1791
In <pa****************************@dcs.nac.uci.edu> , Dan Stromberg wrote:
What's the deal here?


Very hard to tell without more details.

Ciao,
Marc 'BlackJack' Rintsch
Jun 23 '06 #2
Dan Stromberg:
What's the deal here?


The sketchy information in your post doesn't rule out any possibility.

--
René Pijlman
Jun 23 '06 #3
Dan Stromberg <st******@dcs.nac.uci.edu> writes on Thu, 22 Jun 2006 23:36:00 GMT:
I have two different python programs that are slowing down quite a bit as
their memory use goes up.


I have seen this too with Zope.

I do not know where it comes from -- maybe from degraded locality.
Dieter
Jun 25 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
9887
by: TheKeith | last post by:
I'm writing a script with a while loop in it. How can I get it to go slower so that it doesn't appear to happen all at once--so that it looks animated--basically. I tried the setTimeout(500) in the...
3
2187
by: Daragoth | last post by:
Hi, I'm writing a program using Metrowerks CodeWarrior 4.0 that determines the best possible combination of a data set by checking every possible combination. I found there were about 250,000,000...
5
1745
by: Droopy | last post by:
Hi, I am writing a C# program that is calling C++ legacy code. I wrote a C++ managed wrapper for this legacy code. It seems to work well. The legacy code is handling serial (RS232 or RS422)...
5
2710
by: tony | last post by:
I'm using PHP 5 on Win-98 command line (ie no web server involved) I'm processing a large csv file and when I loop through it I can process around 275 records per second. However at around...
7
2569
by: davidst95 | last post by:
Hello, I have a program that runs a long process. I tried to add a thread to check if the use hit a cancel button to abort the process. Dim t As Threading.Thread t = New...
0
7093
by: south622 | last post by:
I'm taking a beginning Java course and I'm stuck in week eight of a nine week course. If anyone could help me I would greatly appreciate it. This assignment was due yesterday and each day I go past...
334
11272
by: Antoninus Twink | last post by:
The function below is from Richard HeathField's fgetline program. For some reason, it makes three passes through the string (a strlen(), a strcpy() then another pass to change dots) when two would...
2
19321
Banfa
by: Banfa | last post by:
Posted by Banfa The previous tutorial discussed what programming is, what we are trying to achieve, the answer being a list of instructions constituting a valid program. Now we will discuss how...
0
913
by: =?Utf-8?B?UnVkeSBNb29yZQ==?= | last post by:
Hi, After my program runs for an hour, it is slowed down dramatically. According to Sysinternals Process Explorer call stack trace, the slow down is due to the function HalClearSoftwareInterrupt...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7423
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7510
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5668
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
447
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.