Hi tadokoro,
That's just the way .NET's dynamic infrastructure works. The initial pass through a dynamic call site is expensive, but inline caching greatly speeds up subsequent passes.
One possibility, as you suggested, would be to replace dynamic calls with normal calls to a common method that holds a single dynamic call site. You'd still take the hit for the very first call though.
Another possibility would be to eliminate the use of the dynamic infrastructure. Unfortunately ClearScript currently doesn't support any alternate API for interacting with script objects.
Thanks!
That's just the way .NET's dynamic infrastructure works. The initial pass through a dynamic call site is expensive, but inline caching greatly speeds up subsequent passes.
One possibility, as you suggested, would be to replace dynamic calls with normal calls to a common method that holds a single dynamic call site. You'd still take the hit for the very first call though.
Another possibility would be to eliminate the use of the dynamic infrastructure. Unfortunately ClearScript currently doesn't support any alternate API for interacting with script objects.
Thanks!