473,394 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Built-in datatypes speed

Hello Python-List

I hope somebody can help me with this. I spent some time googling for an
answer, but due to the nature of the problem lots of unrelevant stuff
shows up.

Anyway, I reimplemented parts of TigerSearch (
http://www.ims.uni-stuttgart.de/proj...R/TIGERSearch/ ) in Python.
I am currently writing the paper that goes along with this
reimplementation. Part of the paper deals with the
differences/similarities in the original Java implementation and my
reimplementation. In order to superficially evaluate differences in
speed, I used this paper (
http://www.ubka.uni-karlsruhe.de/cgi...000/5&format=1
) as a reference. Now, this is not about speed differences between Java
and Python, mind you, but about the speed built-in datatypes
(dictionaries, lists etc.) run at. As far as I understood it from the
articles and books I read, any method call from these objects run nearly
at C-speed (I use this due to lack of a better term), since these parts
are implemented in C. Now the question is:

a) Is this true?
b) Is there a correct term for C-speed and what is it?

I would greatly appreciate an answer to that, since this has some impact
on the argumentation in the paper.

Thanks,

Maël

PS: For people interested in this reimplementation project: my code will
be published here (
http://www.ling.su.se/dali/downloads...gner/index.htm ) as soon as
it is integrated with the GUI and properly tested. The whole thing is
GPLed...
Feb 7 '07 #1
1 1436
On Feb 7, 2:34 am, Maël Benjamin Mettler <mbmett...@access.unizh.ch>
wrote:
Anyway, I reimplemented parts of TigerSearch (http://www.ims.uni-stuttgart.de/proj...R/TIGERSearch/) in Python.
I am currently writing the paper that goes along with this
reimplementation. Part of the paper deals with the
differences/similarities in the original Java implementation and my
reimplementation. In order to superficially evaluate differences in
speed, I used this paper (http://www.ubka.uni-karlsruhe.de/cgi...t=ira/2000/5&f...
) as a reference. Now, this is not about speed differences between Java
and Python, mind you, but about the speed built-in datatypes
(dictionaries, lists etc.) run at. As far as I understood it from the
articles and books I read, any method call from these objects run nearly
at C-speed (I use this due to lack of a better term), since these parts
are implemented in C. Now the question is:

a) Is this true?
b) Is there a correct term for C-speed and what is it?
I think the statement is highly misleading. It is true that most of
the underlying operations on native data types are implemented in c.
If the operations themselves are expensive, they could run close to
the speed of a suitably generic c implementation of, say, a
hashtable. But with richer data types, you run good chances of
landing back in pythonland, e.g. via __hash__, __equals__, etc.

Also, method dispatch to c is relatively slow. A loop such as:

lst = []
for i in xrange(int(10e6)):
lst.append(i)

will spend most of its time in method dispatch and iterating, and very
little in the "guts" of append().

Those guts, mind, will be quick.

-Mike
Feb 9 '07 #2

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

Similar topics

1
by: JimmyT | last post by:
I just configured and installed 2.3.4 and noticed there is no datetime module. I noticed there is a datetimemodule.c file that did not get built (ie no object file). Is there something I need to...
1
by: Alex Elbert | last post by:
Hi I have built dynamic HTMLTable. Now I want to attach it directly to the Email Body - it is already built, so why not to use a ready table. However, I cannot find the way of getting plain HTML...
0
by: Andrew Crook | last post by:
does MYSQL have a quota built into it! I need it limit the size of each database AndiC
1
by: Mark | last post by:
Is there a way to execute a statement that is built dynamically by a .NET application. For example I have a loop that is reading values from a database and I want to do something like the...
4
by: Yasutaka Ito | last post by:
Hi, Is there a way to determine which version of .NET Framework any given assembly is built with? thanks! -Yasutaka
1
by: William | last post by:
Looking for a pre built dotnet corporate or small business website template.
1
by: William | last post by:
Looking for a pre built dot net website for consulting business. I am trying to put up a quick business web for a dot net frame work. I have a provider already. I am trying to save time. Any...
1
by: Daniel | last post by:
is there any way to get to a unique build verion of an assembly at runtime? e.g. a version that is unique to the time that the assembly was built?
48
by: meyer | last post by:
Hi everyone, which compiler will Python 2.5 on Windows (Intel) be built with? I notice that Python 2.4 apparently has been built with the VS2003 toolkit compiler, and I read a post from Scott...
3
by: drewj840 | last post by:
I built a Windows service that sweeps a set of folders every 60 seconds and puts the files into a SQL Server database. I am creating a second service that will delete this set of folders and recreate...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.