Apache 的 Velocity 模板引擎——有史以来最糟糕的软件包?
所以我在一个遗留项目中使用 Velocity。即使渲染中等大的页面也需要很长时间。足足10多分钟。
我一定遇到了某种错误...其他人对 Velocity 总体上有过不好的经历吗?我即将开始逐步浏览源代码并查看它挂在哪里/等等,但我想看看 SO 说了什么。 :)
So I'm using Velocity in a legacy project. And even rendering moderately large pages takes FOREVER. Literally 10+ minutes.
There has to be some kind of bug I'm hitting... anyone else have bad experiences with Velocity in general? I'm about to start stepping through the source code and see where it hangs/etc but I wanted to see what SO had to say. :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您使用什么版本?如果您不说 1.6.4 或 1.7-beta1,那么这就是您的第一个问题。对于大量使用 velocimacros 的人来说,1.5 存在一些严重的性能问题。
是仅在第一次渲染时出现还是在后续渲染中出现?您使用什么资源加载器?缓存开启了吗?您是否尝试将其用作脚本语言?
不要浪费时间逐步完成。这就是分析器的用途。
你的问题,如果可以这么说的话,严重缺乏信息。你只说“X 很慢”。如果您需要帮助,您将必须分享一些有关您实际在做什么的信息。提出一个实际的问题也没有什么坏处。
What version are you using? If you don't say 1.6.4 or 1.7-beta1, then that's your first problem. 1.5 had some serious performance issues for anyone using velocimacros heavily.
And is it just on first render or on subsequent ones too? What resource loader are you using? Is caching on? Are you trying to use it as a scripting language?
Do not waste time stepping through. This is what profilers are for.
Your question, if it can be called that, is severely lacking in information. All you said is "X is slow". If you want help, you're gonna have to share some info about what you're actually doing. And asking an actual question wouldn't hurt either.
在过去的几年里,我断断续续地使用了 Velocity,我发现它是一个强大且可靠的模板引擎。我没有遇到过你所描述的问题,并且发现它总是足够快。
这种延迟看起来像是有什么东西在调用外部服务。 Velocity 使调用对象的方法变得容易。
也许分析器可以阐明这个问题。
I used velocity on and off over the last years and I find it a robust and dependable templating engine. I have not faced the problems you describe and found it always fast enough.
These kind of delays look like there is something calling an external service. Velocity makes it easy to call methods on objects.
Maybe a profiler might shed light on this issue.