From: SourceForge.net <no...@so...> - 2006-02-06 10:23:10
|
Feature Requests item #1166553, was opened at 2005-03-19 17:35 Message generated for change (Settings changed) made by vasiljevic You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=719009&aid=1166553&group_id=130646 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Tcl-API Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Zoran Vasiljevic (vasiljevic) Assigned to: Zoran Vasiljevic (vasiljevic) Summary: Add ttrace module Initial Comment: The ttrace module is written in Tcl and is part of the threading extension and available on SF: http://sourceforge.net/projects/ttrace The basic idea is to use Tcl trace capabilities and replicate state of the Tcl interpreter from one to other threads in a lazy mode. So, instead of loading everything in one interp and then using clumsy introspective script to build the initialization script for other threads the ttrace package loads all procedure, namespace (et al) defs and stuffs them into a shared array. By overloading the Tcl [unknown] command, resources are brought into life as needed. This results in drastic memory footprint reduction and much faster thread creation. I have it running for about 1 year w/o any noticable speed penalty. One of the OpenACS users also tried it and is very pleased. I think we can add this as alternate interp initialization scheme. ---------------------------------------------------------------------- >Comment By: Zoran Vasiljevic (vasiljevic) Date: 2006-02-06 11:23 Message: Logged In: YES user_id=95086 Added into current head (after 4.99.1 release). ---------------------------------------------------------------------- Comment By: Zoran Vasiljevic (vasiljevic) Date: 2005-03-26 19:34 Message: Logged In: YES user_id=95086 Yep. It is little bit difficult to follow. I think I will have to add some more clarifying comments. But the basic idea is trivial. Setup Tcl-level traces on various commands (load, proc, namespace..) and capture the work in nsv_arrays. Then synthethize a small Tcl script which, among other things, overloads the Tcl [unknown] command. The script is passed to each interpreter. During runtime, the [unknown] is responsible for pulling things out ot the nsv_arrays and loading them in the running inter. That's it. OK, the implementation is not that simple, but this is life. It will be more clear when I add some comments there... Bottom line: it works perfectly for me and for some other guys who dared to test it :). Overall, reduction in memory was significant (2-3 times) and the thread init time drop to couple of msecs. ---------------------------------------------------------------------- Comment By: Stephen Deasey (sdeasey) Date: 2005-03-26 19:26 Message: Logged In: YES user_id=87254 Good idea. I remember you mentioning rewriting in C some time ago, is that still the plan? I took a quick look at the ttrace module in sf cvs and had a little trouble following it. I guess that's just the nature of the problem, there seems to be a lot of fiddly things to consider. It would be nice to make it more obvious what steps are being taken, but nothing comes to mind immediately... ---------------------------------------------------------------------- Comment By: Vlad Seryakov (seryakov) Date: 2005-03-19 21:30 Message: Logged In: YES user_id=184124 could be a good option, yes ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=719009&aid=1166553&group_id=130646 |