Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Any downsides to using newproxy(true)?

Asked by
Speedmask 661 Moderation Voter
3 years ago
Edited 3 years ago

the title is about it. I am thinking of replacing many of my standard metatables with a newproxy metatable instead. the only reason being, well, having __len just because I can :). performance when creating them is not a problem because it will only happen once, but they will be indexed often. they will mostly be generated behind one or two functions which is the only place I will use them (not in everyday scripts). so, I'm wondering:

  1. will there be any performance losses aside from creating them in the first place? I am aware of extra memory of course, but is it significant enough to avoid?
  2. I hear it makes things unnecessarily complicated, but I have yet to see any problems, as all I have needed to do so far is getmetatable(newproxy(true)). are there really any further complications I should be aware of?

thanks

0
one of the downsides is that you can't store/set data inside a proxy, you either have to store it inside the __index or another table AnasBahauddin1978 715 — 3y

Answer this question