Hacker News new | past | comments | ask | show | jobs | submit login

Note that the benchmark code is inconsistent - nanb3 and nanb4 allocate 10x the number of objects of nanb and nanb2, so I was getting very surprising results until I realised that and fixed it.

On a 32-bit system, it seems tagged pointers have the advantage:

    nanb 18.562s - NaN boxing
    nanb2 17.484s - tagged pointer
    nanb3 25.468s - tagged structure
    nanb3 with pack(1) 26.000s
    nanb4 20.093s - tagged union
    nanb4 with pack(1) 19.109s
I also tried with pack(1) to see if cache effects would show up, and although it made the tagged structure slightly slower, indeed you can see that the tagged union became faster without alignment padding.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: