summaryrefslogtreecommitdiffstats
path: root/generic/tclEnsemble.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclEnsemble.c')
-rw-r--r--generic/tclEnsemble.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 03bbf03..9d0d874 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -353,6 +353,14 @@ TclNamespaceEnsembleCmd(
Tcl_SetEnsembleMappingDict(interp, token, mapObj);
Tcl_SetEnsembleUnknownHandler(interp, token, unknownObj);
Tcl_SetEnsembleParameterList(interp, token, paramObj);
+ /*
+ * Ensemble should be compiled if it has map (performance purposes)
+ * Currently only for internal using namespace (like ::tcl::clock).
+ * (An enhancement for completelly compile-feature is in work.)
+ */
+ if (mapObj != NULL && strncmp("::tcl::", nsPtr->fullName, 7) == 0) {
+ Tcl_SetEnsembleFlags(interp, token, ENSEMBLE_COMPILE);
+ }
/*
* Tricky! Must ensure that the result is not shared (command delete