| Let's take floating points as an example for boxing-unboxing. Floats in Squeak have a platform-independent format (endian of the processor doesn't matter) and some object header information. Floats in a given OS are some format to make it easier for FP operations. Converting from object->native format is called "unboxing", and putting the result back into an object is called "boxing." The reality is that the biggest time sink in many primitives is boxing and unboxing. For example, one of my students is working with OpenGL in Squeak. OpenGL is zoomer-fast, but he's finding that the overall result is slower than using Squeak's built-in 3D renderer! Why? Because of the time cost associated with getting the OpenGL bits into the Squeak object Display (e.g., dealing with color differences, dealing with format differences, etc.) and vice-versa: Boxing-unboxing problems. Mark Guzdial |