lang: interpolate, funcs: Add a concat function for faster interpolation
This adds a concat function which can be used directly by string interpolation to avoid having to constantly unify the plus operator which is much slower at this time. The new monomorphisms changes caused type unification of a notable example to go from ~25s to ~5m30s which was obviously not bearable. With this fix, things are now down to ~6s. This is an important optimization, but it's also a good reminder that type unification of polymorphic functions needs to be improved in general too.
This commit is contained in:
@@ -44,6 +44,11 @@ const (
|
||||
|
||||
// CoreDir is the directory prefix where core mcl code is embedded.
|
||||
CoreDir = "core/"
|
||||
|
||||
// ConcatFuncName is the name the concat function is registered as. It
|
||||
// is listed here because it needs a well-known name that can be used by
|
||||
// the string interpolation code.
|
||||
ConcatFuncName = "concat"
|
||||
)
|
||||
|
||||
// registeredFuncs is a global map of all possible funcs which can be used. You
|
||||
|
||||
Reference in New Issue
Block a user