Changes between Version 4 and Version 9 of Ticket #5979


Ignore:
Timestamp:
Mar 25, 2021, 5:43:34 PM (3 years ago)
Author:
Freagarach
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5979 – Description

    v4 v9  
    66
    77Also booleans are a good example of variables that need not to be initialised.
     8
     9Some discussion was performed on Phab:rP25119 (text by smiley):
     10 Maybe explicitly defining serializable properties might be cleaner. And if performance is the concern, setting a boolean is definitely faster than deleting properties and re initializing them again. There is also the issue of type optimizations potentially.
     11
     12 Potential performance impacts would depend on the JS engine, but I recall from some earlier benchmark that delete was kinda expensive since further lockups would result in searching the prototype chain. Also, it might change the object layout. Moreover, SM JIT does not play well with delete on arrays and hitting array holes was like hitting a wall. Given the underlying JS array implementation, I would not be surprised if the same behavior was found in objects as well.
     13
     14 I haven't redone those tests in current SM version. So, take that however you will.