[Glass] CharacterCollection #asNumber

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Glass] CharacterCollection #asNumber

Mariano Martinez Peck
Hi guys,

I am profiling a bit my app and it seems that CharacterCollection #asNumber is not that fast. 
but...first I have a question. If I browse CharacterCollection, the method #asNumber is under 2 categories at the same time: 'Converting' and '*squeak-converting'. How is that possible?

Second....is there a native/optimized version of such a method?


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] CharacterCollection #asNumber

Dale Henrichs-3
Mariano,

GemStone does not have a "native asNumber" for CharacterCollection...however, there are primitive calls that can be 20 times faster than asNumber, but you have to know ahead of time whether or not the string you pass is an Integer or  a Float ... take a look at implementors of #fromString: ...

Dale


From: "Mariano Martinez Peck" <[hidden email]>
To: [hidden email]
Sent: Wednesday, December 11, 2013 2:30:22 PM
Subject: [Glass] CharacterCollection #asNumber

Hi guys,

I am profiling a bit my app and it seems that CharacterCollection #asNumber is not that fast. 
but...first I have a question. If I browse CharacterCollection, the method #asNumber is under 2 categories at the same time: 'Converting' and '*squeak-converting'. How is that possible?

Second....is there a native/optimized version of such a method?


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] CharacterCollection #asNumber

Mariano Martinez Peck



On Sat, Dec 14, 2013 at 9:34 PM, Dale K. Henrichs <[hidden email]> wrote:
Mariano,

GemStone does not have a "native asNumber" for CharacterCollection...however, there are primitive calls that can be 20 times faster than asNumber, but you have to know ahead of time whether or not the string you pass is an Integer or  a Float ... take a look at implementors of #fromString: ...

Exactly!!! I noticed exactly that...that most classes had a fromString: which ended up in a primitive. So yes, I imagined that would be way faster. 
Right now I am "guessing" the type doing some simple parser. But for some files I do know the expected time for each column. So for those cases I will try to use these optimized #fromString:


Thanks Dale 
 

Dale


From: "Mariano Martinez Peck" <[hidden email]>
To: [hidden email]
Sent: Wednesday, December 11, 2013 2:30:22 PM
Subject: [Glass] CharacterCollection #asNumber


Hi guys,

I am profiling a bit my app and it seems that CharacterCollection #asNumber is not that fast. 
but...first I have a question. If I browse CharacterCollection, the method #asNumber is under 2 categories at the same time: 'Converting' and '*squeak-converting'. How is that possible?

Second....is there a native/optimized version of such a method?


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass




--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass