Avoid using "StringComparer.OrdinalIgnoreCase" ?

322 views
Skip to first unread message

Rodrigo Zechin

unread,
Feb 26, 2014, 11:29:36 AM2/26/14
to rav...@googlegroups.com
During a profiling session of my code I noticed a hotspot where "StringComparer.OrdinalIgnoreCase" was involved.

Searching our code, I could not find any usages of it, so I investigated further and found that it was actually called by RavenDb (I use it in embedded mode, so it was profiled along with my code).

I did some quick tests which proved that this implementation was slow as hell on .NET 4.0... so I did a quick google search and found the following:

It seems RavenDb makes heavy usage of OrdinalIgnoreCase, so it might be a good idea to switch over to InvariantCultureIgnoreCase ?

Kijana Woodard

unread,
Feb 26, 2014, 11:34:47 AM2/26/14
to rav...@googlegroups.com
What version of Raven are you using?
Any idea if .net 4.5/4.5.1 contain the fix?


--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Rodrigo Zechin

unread,
Feb 26, 2014, 1:48:36 PM2/26/14
to rav...@googlegroups.com
<package id="RavenDB.Embedded" version="2.5.2750" targetFramework="net40" />

Looks like it has been fixed on 4.5 from the comments, but I had not confirmed it myself...

Oren Eini (Ayende Rahien)

unread,
Feb 27, 2014, 1:50:22 AM2/27/14
to ravendb
We make heavy use of it because:
- It is supported on Silverlight, WP, etc.
- It was supposed to be faster according to the docs.

I don't think that we have the option of making this change at this time for 2.5, and 3.0 is already running on 4.5

 RavenDB Conference

Oren Eini

CEO

Mobile: + 972-52-548-6969

Office:  + 972-4-674-7811

Fax:      + 972-153-4622-7811






--

Rodrigo Zechin

unread,
Feb 27, 2014, 1:03:11 PM2/27/14
to rav...@googlegroups.com
I agree it might be risky for a last-minute change like this on 2.5 - but maybe you could consider this for a future release of 2.5...

Regarding 3.0, does this mean you will not support .NET 4.0 anymore??


--
You received this message because you are subscribed to a topic in the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ravendb/BGqU6cerwb4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ravendb+u...@googlegroups.com.

Oren Eini (Ayende Rahien)

unread,
Feb 27, 2014, 4:47:39 PM2/27/14
to ravendb
3.0 is going to run on 4.5 only.

 RavenDB Conference

Oren Eini

CEO

Mobile: + 972-52-548-6969

Office:  + 972-4-674-7811

Fax:      + 972-153-4622-7811






Chris Marisic

unread,
Feb 28, 2014, 9:11:39 AM2/28/14
to rav...@googlegroups.com
Is that in regards to the server only, or server and client? 

[either way i think its the correct decision to not hamstring yourself]

Oren Eini (Ayende Rahien)

unread,
Mar 1, 2014, 7:24:50 AM3/1/14
to ravendb
It is both server & client. 2.5 clients will work with 3.0, same as 1.0 clients.

 RavenDB Conference

Oren Eini

CEO

Mobile: + 972-52-548-6969

Office:  + 972-4-674-7811

Fax:      + 972-153-4622-7811






Reply all
Reply to author
Forward
0 new messages