Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Encoding of Floating Point Numbers

 
Kiran Kumar
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Kiran Kumar
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic