aspose file tools*
The moose likes Web Services and the fly likes Encoding of Floating Point Numbers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Encoding of Floating Point Numbers" Watch "Encoding of Floating Point Numbers" New topic
Author

Encoding of Floating Point Numbers

Kiran Kumar
Ranch Hand

Joined: Jan 06, 2003
Posts: 91
Considering a client-server architecture using XML, does the performance degrade if a client or server send floating pt. numbers to each other?
Any thoughts about this are appreciated.
Thanks,
Kiran


------------<br />SCJP
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Well, depends on how you define "degrading". Sending an 8-byte floating point number will definitely take longer the decode and encode than an 8-byte string. Numeric conversion always requires more CPU cycles than character conversion.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Kiran Kumar
Ranch Hand

Joined: Jan 06, 2003
Posts: 91
So, do you mean to say its not about XML?
I know that encoding/decoding of floating pt. numbers consume lot of cpu cycles, but is representing floating pt. numbers in XML costly?
Can you please give me an example of a 5 Byte flaoting pt. number?
Thanks,
Kiran
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
So, do you mean to say its not about XML?
I know that encoding/decoding of floating pt. numbers consume lot of cpu cycles, but is representing floating pt. numbers in XML costly?
What I mean to say is that whileI know floating point numbers take more time to encode and decode, I haven't heard of an occasion when that has been the performance bottleneck.
Can you please give me an example of a 5 Byte flaoting pt. number?
Umm, no? Most of the time you're dealing with either 4- (float) or 8-byte (double) floating point numbers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Encoding of Floating Point Numbers