From: Harmeet B. <ha...@ko...> - 2003-06-17 03:14:51
|
["Harmeet Bedi" <ha...@ko...>] > > - Precompiled/Optimized templates: A mode to generate java code and classes > > from wm files would be good. ["Brian Goetz" <br...@qu...>] > Why? For performance, or for another reason? ["Harmeet Bedi" <ha...@ko...>] Performance and more importantly don't want to deploy source tempates on production server. There is no need to reload and don't want a someone/me to open file and make a mistake. ["Brian Goetz" <br...@qu...>] > Again, do you have any grounds for suspecting that WM has performance > problems, or is this just a "its interpreted, so it must be slow" thing? ["Harmeet Bedi" <ha...@ko...>] No I haven't and looking at the source code it appears that WM developers have spent good time on tuning. Also WM seems very responsive. It is more based on the gut feel that you are using Java interpreter and WM interpretter on top of it, if you remove one layer the system becomes easier to understand and profile. This is esp. important if one does not care about reloading templates. [From: "Marc Palmer" <ma...@an...>] > Like Brian I think this is a bad idea. Generating (or compiling) code is > not a good plan for template-based scripting. It complicates things and you ... > You might benefit from some compile-time optimisations but like Brian I > doubt it would be significant. ["Harmeet Bedi" <ha...@ko...>] As a general rule, yes I agree templates don't need compilation and it robs them of power, but as a user in one case I don't want the templates to be modifiable. Structure to support dynamic reloading of templates is unnecessary. A jar file with classes may be more comfortable than deploying source templates. These classes could be generated from wm templates. I am not sure why it would complicate things. I was thinking it would be a translation into java objects from wm template and writing the restulting structure on disk rather than executing when user hits a template. ["Harmeet Bedi" <ha...@ko...>] > > - Throttling. Would be cool to have a way to monitor long running threads > > and maybe reduce priority or kill those threads. A threshold time check and > > unchecked error if limit is reached may be one way I could think of. > ["Brian Goetz" <br...@qu...>] > WM doesn't create its threads, it uses the threads given it by the > environment (such as the servlet container.) Pruning these is the > container's job. ["Harmeet Bedi" <ha...@ko...>] True but WM could say a thread local variable which monitors start time of interaction and check for threashold at different points and if the execution time is more than allowed throw a runtime exception. ["Harmeet Bedi" <ha...@ko...>] > > - Sandbox. I realize that WM templates depends only on model, but it > > would > > be nice to make the view as tight as possible "Marc Palmer" <ma...@an...> > There's also the problem of providing runtime help information for template > writers, tackled to a large degree by my Ignition webapp. We could solve > both of these problems in one go, very simply: > > * Add an option to WM for "StrictJavaClasses" mode. (and > "StrictJavaClassesExcludes=") > * Add a flagging interface called something like WMScriptSafe ... > By having the flagging interface we are forcing people to implement a new > class that wraps non-safe classes, therefore giving them the ability to ["Harmeet Bedi" <ha...@ko...>] Thanks for the tip, will look into Ignition. The one problem with wrapping a unsafe object is that often it is hard to figure out what is safe and not. So it would be nice if WM folks could provide a set of object wrapper with degrees of safety. So for instance NoviceReadonlySafeHttpServletRequest for some templates and maybe a more advanced AdvancedRedirectAndContextAllowedSafeHttpServeletRequest for a more power user. I realize though that this is slippery slope and users may want different things, but I also think some common safe objects could help a lot. ["Harmeet Bedi" <ha...@ko...>] > > - Safe. Loops and cyclic loops can be written in JSP. With webmacro it is > > very hard. I use 1.0 with constraints on include directive to control > > looping( I only allow templates in subfolders and no url include). WM > > Templates should not be able to bring server down, either by intent or by > > coding error. Of course this does depend on exposed model, but if model > > safe, templates should be safe too. ["Marc Palmer" <ma...@an...>] > I don't see how #include can bring the server down. You get a ["Harmeet Bedi" <ha...@ko...>] Sorry I ment that it shold not cause stack overflow. It has a bad impact on CPU and can cause other requests to be less responsive. Assuming (a) model and context varialbes exposed to templates is well thought out and safe, and (b) anyone is allowed to add their templates, it would be really nice if there can a way to prevent stack overflow condition. It would be harder to debug these conditions for a end user and would have less than nice impact on server, so would be nice to have way to prevent it. Harmeet |