Reducing data through control of numerical values

Hi All,

I am a relatively new user to Rhino, and am starting to explore the joys of Grasshopper.

I am currently writing a module/script/cluster which is likely to be used many times over throughout my designs which might result in large amounts of data being generated.

I have some experience in dealing with this problem in other software and have often found reducing the number of bits used to hold the number has been effective at speeding things up.

My question is, if I know that my output is never going to need to be more accurate than #.##, how can I manipulate my output so that I can create an 8 bit number?

Many thanks,


You process floating numbers with a size of 8 bytes by default (= double). Converting this to a float (4 bytes) or a rounded byte (1 byte) or ushort (2bytes) doesn’t help you at all since all the data is processed as a double or integer at a later stage anyway. By reducing the bits or bytes you also do not improve speed in first place but you reduce memory consumption. As long as you not going to process millions of double values there shouldn’t be a problem with that. Performance hits are the result of many other issues. You’ll need to share your definition if you want concrete help.

Hi Tom Tom,

Thanks for that. I didn’t realise that all processes were completed using doubles anyway, so I’ll park that line of thought for now.

Regarding your point about memory and speed, yes that is true, but I have found in the past reducing the memory use helps to speed up the process, in that case I was generating millions of numbers. In this case I might be generating thousands, but not millions.

Thanks again,