Recent

Author Topic: sealed class and fpc_do_is  (Read 1486 times)

BeniBela

  • Hero Member
  • *****
  • Posts: 906
    • homepage
sealed class and fpc_do_is
« on: April 30, 2016, 11:25:31 pm »
So if you have a sealed class, (variable is TSealedClass) should always be equivalent to ((variable <> nil) and (variable.classtype =  TSealedClass))

Yet, fpc replaces the is with a call to fpc_do_is, which after quick benchmarking is to 2 to 3 times slower than the classtype comparison.

That is not good

Why does it not use the direct comparison? Any plans to change that

 

TinyPortal © 2005-2018