dcbaker / meson-plus-plus

An experimental and incomplete implementation of Meson in C++, for solving Meson's bootstrapping issue.
Apache License 2.0
50 stars 7 forks source link

Refactor function lowering #88

Closed dcbaker closed 2 years ago

dcbaker commented 2 years ago

Currently, on each object, for each function lowering method, we check if the thing is a function, then we check the holder, and the name of the function, returning if the current lowering function doesn't act on it. This is pretty inefficient, just in our very limited tests it adds about .01 seconds to the run time, and there area a lot of unimplemented functions and methods. The new code is not perfect, but it uses a dispatch function to avoid some of the overhead by only doing the variant extraction once, as well as the name and holder check once.

Fixes #87