mail-archives/mono-bugs/2009-March/087387.html

143 строки
5.1 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 490021] New: Performance improvement in SQLiteConvert
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20490021%5D%20New%3A%20Performance%20improvement%20in%0A%09SQLiteConvert&In-Reply-To=">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="087390.html">
<LINK REL="Next" HREF="087388.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 490021] New: Performance improvement in SQLiteConvert</H1>
<B>bugzilla_noreply at novell.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20490021%5D%20New%3A%20Performance%20improvement%20in%0A%09SQLiteConvert&In-Reply-To="
TITLE="[Mono-bugs] [Bug 490021] New: Performance improvement in SQLiteConvert">bugzilla_noreply at novell.com
</A><BR>
<I>Sat Mar 28 16:20:12 EDT 2009</I>
<P><UL>
<LI>Previous message: <A HREF="087390.html">[Mono-bugs] [Bug 490016] Enumerable.Intersect(...) doesn't follow the spec
</A></li>
<LI>Next message: <A HREF="087388.html">[Mono-bugs] [Bug 490021] Performance improvement in SQLiteConvert
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#87387">[ date ]</a>
<a href="thread.html#87387">[ thread ]</a>
<a href="subject.html#87387">[ subject ]</a>
<a href="author.html#87387">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE><A HREF="https://bugzilla.novell.com/show_bug.cgi?id=490021">https://bugzilla.novell.com/show_bug.cgi?id=490021</A>
Summary: Performance improvement in SQLiteConvert
Classification: Mono
Product: Mono: Class Libraries
Version: SVN
Platform: All
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Mono.Data.Sqlite
AssignedTo: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mhabersack at novell.com</A>
ReportedBy: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">bertrand.lorentz at gmail.com</A>
QAContact: <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">mono-bugs at lists.ximian.com</A>
Found By: ---
The associations between type names and the corresponding DbType are currently
stored in a static array.
Each time the TypeNameToDbType method is called, it goes through this array,
doing a string comparison on potentially all 43 elements.
I'll post a patch that replaces the array with a Dictionary, for more efficient
lookups.
Here's what I get by running banshee SVN trunk with mono --profile :
Before the patch
Time(ms) Count P/call(ms) Method name
########################
690.002 1608 0.429
Mono.Data.Sqlite.SqliteConvert::TypeNameToDbType(string)
Callers (with count) that contribute at least for 1%:
1472 91 % Mono.Data.Sqlite.SqliteDataReader::GetSqliteType(int)
136 8 %
Mono.Data.Sqlite.SqliteConvert::ColumnToType(SqliteStatement,int)
&lt;snip&gt;
########################
681.777 24400 0.028
System.String::Compare(string,int,string,int,int,bool,CultureInfo)
Callers (with count) that contribute at least for 1%:
24400 100 % Mono.Data.Sqlite.SqliteConvert::TypeNameToDbType(string)
After applying the patch :
########################
5.496 1608 0.003
Mono.Data.Sqlite.SqliteConvert::TypeNameToDbType(string)
Callers (with count) that contribute at least for 1%:
1472 91 % Mono.Data.Sqlite.SqliteDataReader::GetSqliteType(int)
136 8 %
Mono.Data.Sqlite.SqliteConvert::ColumnToType(SqliteStatement,int)
&lt;snip&gt;
########################
3.852 1608 0.002
System.Collections.Generic.Dictionary`2::TryGetValue(string,DbType&amp;)
Callers (with count) that contribute at least for 1%:
1608 100 % Mono.Data.Sqlite.SqliteConvert::TypeNameToDbType(string)
--
Configure bugmail: <A HREF="https://bugzilla.novell.com/userprefs.cgi?tab=email">https://bugzilla.novell.com/userprefs.cgi?tab=email</A>
------- You are receiving this mail because: -------
You are the QA contact for the bug.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="087390.html">[Mono-bugs] [Bug 490016] Enumerable.Intersect(...) doesn't follow the spec
</A></li>
<LI>Next message: <A HREF="087388.html">[Mono-bugs] [Bug 490021] Performance improvement in SQLiteConvert
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#87387">[ date ]</a>
<a href="thread.html#87387">[ thread ]</a>
<a href="subject.html#87387">[ subject ]</a>
<a href="author.html#87387">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>