Click here to Skip to main content
15,905,144 members
Home / Discussions / C#
   

C#

 
GeneralRe: converting c header file in c# Pin
Luc Pattyn6-Jan-09 23:11
sitebuilderLuc Pattyn6-Jan-09 23:11 
GeneralRe: converting c header file in c# Pin
lawrenceinba6-Jan-09 23:27
lawrenceinba6-Jan-09 23:27 
QuestionFast string to integer conversion Pin
HosamAly6-Jan-09 19:58
HosamAly6-Jan-09 19:58 
AnswerRe: Fast string to integer conversion Pin
N a v a n e e t h6-Jan-09 21:10
N a v a n e e t h6-Jan-09 21:10 
GeneralRe: Fast string to integer conversion Pin
HosamAly6-Jan-09 22:29
HosamAly6-Jan-09 22:29 
GeneralRe: Fast string to integer conversion Pin
J4amieC6-Jan-09 23:08
J4amieC6-Jan-09 23:08 
GeneralRe: Fast string to integer conversion Pin
HosamAly6-Jan-09 23:15
HosamAly6-Jan-09 23:15 
GeneralRe: Fast string to integer conversion Pin
J4amieC6-Jan-09 23:54
J4amieC6-Jan-09 23:54 
Ok, I see.

The performance issue with Int32.Parse is because, like alot of things in the framework, it tries to cater for every man's needs and therefore includes the ability, and logic (therefore overhead) to parse lots of different types of string (eg, currency, hex etc).

If you are satisfied that you are only receiving decimal-formatted numbers, without any other markup (such as separators) you could look at Int32.Parse in reflector and follow the trail to the unmanaged code that does the actual parsing - this will lead you into an internal class called Number which has an unsafe method ParseNumber that does the bulk of the work. Your job would be to identify the bit that parses a decimal-formatted number and just extract that portion into your own library.
AnswerRe: Fast string to integer conversion Pin
Dragonfly_Lee6-Jan-09 22:14
Dragonfly_Lee6-Jan-09 22:14 
GeneralRe: Fast string to integer conversion Pin
HosamAly6-Jan-09 22:27
HosamAly6-Jan-09 22:27 
GeneralRe: Fast string to integer conversion Pin
Dragonfly_Lee6-Jan-09 22:42
Dragonfly_Lee6-Jan-09 22:42 
AnswerRe: Fast string to integer conversion Pin
Guffa6-Jan-09 23:49
Guffa6-Jan-09 23:49 
GeneralRe: Fast string to integer conversion Pin
N a v a n e e t h7-Jan-09 0:04
N a v a n e e t h7-Jan-09 0:04 
GeneralRe: Fast string to integer conversion Pin
Le centriste7-Jan-09 1:13
Le centriste7-Jan-09 1:13 
GeneralRe: Fast string to integer conversion Pin
HosamAly7-Jan-09 8:59
HosamAly7-Jan-09 8:59 
GeneralRe: Fast string to integer conversion Pin
Le centriste7-Jan-09 9:16
Le centriste7-Jan-09 9:16 
GeneralRe: Fast string to integer conversion Pin
Guffa7-Jan-09 2:46
Guffa7-Jan-09 2:46 
GeneralRe: Fast string to integer conversion Pin
HosamAly7-Jan-09 8:31
HosamAly7-Jan-09 8:31 
QuestionCalling C# Managed code in VB Pin
satsumatable6-Jan-09 19:47
satsumatable6-Jan-09 19:47 
AnswerRe: Calling C# Managed code in VB Pin
Mycroft Holmes6-Jan-09 20:31
professionalMycroft Holmes6-Jan-09 20:31 
AnswerRe: Calling C# Managed code in VB Pin
Spoon656-Jan-09 22:25
Spoon656-Jan-09 22:25 
AnswerRe: Calling C# Managed code in VB Pin
Dragonfly_Lee6-Jan-09 22:50
Dragonfly_Lee6-Jan-09 22:50 
AnswerRe: Calling C# Managed code in VB Pin
Jason C Bourne7-Jan-09 11:12
Jason C Bourne7-Jan-09 11:12 
Questionreturn 0? Pin
dec826-Jan-09 19:29
dec826-Jan-09 19:29 
AnswerRe: return 0? Pin
mav.northwind6-Jan-09 19:59
mav.northwind6-Jan-09 19:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.