2 ms·
I'm a little disappointed that people are still talking about tagged ints. There are so many better ways to avoid the overheap of integers being a refrence ty
by kingkilr 15y ago
I'm a little disappointed that people are still talking about tagged ints. There are so many better ways to avoid the overheap of integers being a refrence type (namely type specializing everything under the sun, particularly your JIT'd code and data structures).
- xyzzyz 15y agoCould you please tell me something more about it? Tagged unboxed data seems to be a nice solution for me.
- kingkilr 15y agoWell, the problem with it is it has a negative performance impact on everything else in your codebase, the first time you see any pointer you need to check if it's tagged or not. The advantages are clear: you don't need to allocate anything on the heap for integers. Which means you're sacrificing performance on everything else, for integers. Solutions such as automatic type-specializing containers don't carry this downside, and carry the same upside. For example at the moment PyPy type-specializes dictionaries. Python has a single `dict` type, which can store anything, but we type specialize and fallback if we get it wrong. Similarly, we're working on type-specializng lists, tuples, and user objects. If there's anything more I can answer let me know.