<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 29 Jan 2013, at 16:25, Sanne Grinovero wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Glad you started work on that :)<br></div></blockquote><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font>Any currentTimeMillis() even today will blow away your cache line and<br>probably trigger a context switch.<br><br>Having it as a service we will be able to experiment: the first thing<br>I'll do is replace it with a NOOPService and see how much it improves.<br></div></blockquote><div>That should be the first step IMO. No point in trying to start optimising before we know this is a performance problem :-) </div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font>Ideally I'd like it to have multiple methods so that different needs<br>can hint about a different level of precision, or maybe expect an enum<br>as parameter which represents the hint.<br><br>Cheers,<br>Sanne<br><br>On 29 January 2013 16:02, Manik Surtani <<a href="mailto:msurtani@redhat.com">msurtani@redhat.com</a>> wrote:<br><blockquote type="cite">Thinking about Sanne's idea re: a clock service and not continuously relying on System.cTM, I stumbled upon this:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><a href="https://blogs.oracle.com/ksrini/entry/we_take_java_performance_very">https://blogs.oracle.com/ksrini/entry/we_take_java_performance_very</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">The last section re: caching is interesting.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Having all code use a Clock.currentTimeMillis() and having an implementation that kicks off a scheduled task to update a cached value every $frequency millis (by using the System call) is probably the correct way to implement something like this, but this adds complexities/concerns:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">* CPU cache line blowing away (see article)<br></blockquote><blockquote type="cite">* Context switching<br></blockquote><blockquote type="cite">* Managing an extra service thread<br></blockquote><blockquote type="cite">* Probably an additional configuration option to configure that thread, its priority and frequency. If frequency is dropped (e.g., every second) I suppose the perf gains would be huge.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">JGroups - does JGroups make many and frequent calls to System.cTM as well?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Cheers<br></blockquote><blockquote type="cite">Manik<br></blockquote><blockquote type="cite">--<br></blockquote><blockquote type="cite">Manik Surtani<br></blockquote><blockquote type="cite"><a href="mailto:manik@jboss.org">manik@jboss.org</a><br></blockquote><blockquote type="cite"><a href="http://twitter.com/maniksurtani">twitter.com/maniksurtani</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Platform Architect, JBoss Data Grid<br></blockquote><blockquote type="cite"><a href="http://red.ht/data-grid">http://red.ht/data-grid</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">_______________________________________________<br></blockquote><blockquote type="cite">infinispan-dev mailing list<br></blockquote><blockquote type="cite"><a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br></blockquote><blockquote type="cite"><a href="https://lists.jboss.org/mailman/listinfo/infinispan-dev">https://lists.jboss.org/mailman/listinfo/infinispan-dev</a><br></blockquote><br>_______________________________________________<br>infinispan-dev mailing list<br><a href="mailto:infinispan-dev@lists.jboss.org">infinispan-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/infinispan-dev<br></div></blockquote></div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Cheers,</div><div>-- <br>Mircea Markus</div><div>Infinispan lead (<a href="http://www.infinispan.org">www.infinispan.org</a>)</div><div><br></div></div></span></div></span></div></span></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></body></html>