Closure-based objects and JIT compilation

  • From: Aleksandar Kordic <alexandarkordic@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sun, 3 Nov 2013 13:11:11 +0100

Hi,

While testing Closure-based object system [1] approach I have noticed
that creating new set of functions for every new object stops JIT
compiler optimizations because each object has its own function
instances that do share the same code but have different upvalues.

Do I need to avoid upvalues ? What are the best techniques for
associating data to functions ?



[1] http://lua-users.org/wiki/ObjectOrientationTutorial

-- 
Kind Regards,
Alex

Other related posts: