我有一个相当复杂和性能关键的Haskell程序.我已经使用成本中心分析来优化到没有主要剩余热点的点.此外,该程序的运行速度-O2比(并且没有分析)快15倍stack build --profile,因此我怀疑成本中心分析器是否能够帮助找到优化后的瓶颈.
找到优化后仍然存在的热点有哪些选择?我知道这个问题很奇怪,但它在文档中被描述为不仅仅是"凡人",而我只是凡人.
我正在尝试使用JSF/Primefaces在应用程序中设置CDI(用于@ConversationScoped)并部署在Jetty上.我收到这个例外(我相信)是一个非常基本的ConversationScoped bean.已经梳理了我能找到的所有相关搜索结果,并且没有任何建议,所以将会感激任何建议.
@Named
@ConversationScoped
public class RegisterBean implements Serializable {
...
private @Inject Conversation conversation;
...
public String doSubmitBasicInfo() {
conversation.begin();
if(accountType == null)
return null;
if(accountType.equals("seller_account"))
return "register_seller_1?faces-redirect=true";
else if(accountType.equals("buyer_account"))
return "register_buyer_1?faces-redirect=true";
return null;
}
...
Run Code Online (Sandbox Code Playgroud)
JSF页面的相关部分是:
<div style="text-align:center;" class="noBorder autoMargin">
<p:commandButton type="submit" action="#{registerBean.doSubmitBasicInfo}" ajax="false" value="Submit" styleClass="autoMargin"></p:commandButton>
</div>
Run Code Online (Sandbox Code Playgroud)
例外是:
javax.enterprise.context.ContextNotActiveException: Conversation Context not active when method called on conversation Conversation with id: 1
at org.jboss.weld.context.conversation.ConversationImpl.verifyConversationContextActive(ConversationImpl.java:197)
at org.jboss.weld.context.conversation.ConversationImpl.getLastUsed(ConversationImpl.java:154)
at org.jboss.weld.context.AbstractConversationContext.isExpired(AbstractConversationContext.java:337)
at org.jboss.weld.context.AbstractConversationContext.invalidate(AbstractConversationContext.java:285)
at org.jboss.weld.jsf.WeldPhaseListener.deactivateConversations(WeldPhaseListener.java:146)
at org.jboss.weld.jsf.WeldPhaseListener.afterPhase(WeldPhaseListener.java:91)
at com.sun.faces.lifecycle.Phase.handleAfterPhase(Phase.java:189)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:107) …Run Code Online (Sandbox Code Playgroud) 当模板包含语法错误时,Jinja 会抛出一个 TemplateSyntaxError,它的lineno属性包含发生错误的模板行号。
发生非语法错误的错误时如何获取行号?例如,以下标签:
{{ len(SettlementDate)+1 }}
Run Code Online (Sandbox Code Playgroud)
如果 SettlementDate 不是类似列表的内容,则会导致 Jinja 抛出 TypeError。我如何才能找出发生此错误的位置,以便向用户报告?对于我的用例,提前清理上下文变量不是一种选择。