public static final AtomicLongArray latency = new AtomicLongArray(10000000);
public static final AtomicInteger index = new AtomicInteger(0);
public static Var intern(Namespace ns, Symbol sym, Object root){
long start = System.nanoTime();
// interesting work
Var v = intern(ns, sym, root, true);
long finish = System.nanoTime();
int i = RT.index.getAndIncrement(); // get next slot id
RT.latency.set(i, finish - start); // set the work time in the slot
return v;
}
int count = RT.index.get();
System.out.println("Total Var.intern calls: " + count);
ArrayList<Long> al = new ArrayList<>();
for (int i = 0; i < count; i++) {
al.add(i, RT.latency.get(i));
}
List<Long> l = al.stream().sorted().collect(Collectors.toList());
Long total = al.stream().reduce((a, b) -> a + b).get() / 1_000_000;
double pctl99 = 0.99 * count;
double pctl50 = 0.5 * count;
System.out.println(
" Min: " + l.get(0) + "ns," +
" Median: " + l.get((int)pctl50) + "ns," +
" 99PCTL: " + l.get((int)pctl99) + "ns," +
" Max: " + l.get(count - 1) / 1_000_000 + "ms," +
" Total: " + total + "ms");
Min: 162ns, Median: 907ns, 99PCTL: 30724ns, Max: 10ms, Total: 27ms
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This approach to measurement is likely to skew the results. I'd start with perf record via perf-map-agent and then use flame graphs.
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nathan,
You mentioned that it was clojure startup time that you want to improve. Is it a general "all clojure apps" issue or "our clojure apps?" What are typical times for the entire startup that you observe? What do the clojure apps actually do?
Some points:
Precision/noise:
As Kirk described, calling System.nanoTime() costs about 28 nanos on a one year old Haswell CPU. It just doesn't work to use it to measure operations that themselves take tens or hundreds of nanos.
Skewing
Martin Thompson alluded to how measurement can skew behavior of the underlying system. JMH can’t avoid the Heisenberg effect. Perf-map reduces Heisenberg cost because you are tracing from outside the process (but still on the host). Taking measurements out-of-band is the only way I know to avoid Heisenberg
Host issues
When you said "spin up a linux box" did you mean a physical box, not a VM or container?
I've had a bunch of consulting projects that were different variations on “performance issues that only occur in environment X or on hardware Y”. It common for people to assume “performance is relative. If this is a hotspot here it will be a hotspot here”
All of the points described here require that you have root access to physical hosts that are representative of your target hardware. In larger (and some small) shops this isn’t always easy to get.
Thank-you I ran across an article by Brandon Gregg and was just starting to dig into honest-profiler. Looks like I'll spin up a linux box instead to use perf-map-agent.
On Sat, 23 Sep 2017 at 14:58 Martin Thompson <mjp...@gmail.com> wrote:
This approach to measurement is likely to skew the results. I'd start with perf record via perf-map-agent and then use flame graphs.--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Nathan,
You mentioned that it was clojure startup time that you want to improve. Is it a general "all clojure apps" issue or "our clojure apps?"
What are typical times for the entire startup that you observe? What do the clojure apps actually do?
Some points:
Precision/noise:
As Kirk described, calling System.nanoTime() costs about 28 nanos on a one year old Haswell CPU. It just doesn't work to use it to measure operations that themselves take tens or hundreds of nanos.
Skewing
Martin Thompson alluded to how measurement can skew behavior of the underlying system. JMH can’t avoid the Heisenberg effect. Perf-map reduces Heisenberg cost because you are tracing from outside the process (but still on the host). Taking measurements out-of-band is the only way I know to avoid Heisenberg
Host issues
When you said "spin up a linux box" did you mean a physical box, not a VM or container?
I've had a bunch of consulting projects that were different variations on “performance issues that only occur in environment X or on hardware Y”. It common for people to assume “performance is relative. If this is a hotspot here it will be a hotspot here”
All of the points described here require that you have root access to physical hosts that are representative of your target hardware. In larger (and some small) shops this isn’t always easy to get.
On Saturday, September 23, 2017 at 10:51:52 AM UTC-4, Nathan Fisher wrote:
Thank-you I ran across an article by Brandon Gregg and was just starting to dig into honest-profiler. Looks like I'll spin up a linux box instead to use perf-map-agent.
On Sat, 23 Sep 2017 at 14:58 Martin Thompson <mjp...@gmail.com> wrote:
This approach to measurement is likely to skew the results. I'd start with perf record via perf-map-agent and then use flame graphs.--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--- sent from my mobile
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--- sent from my mobile
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-sympathy+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--- sent from my mobile
--
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
----- sent from my mobile
You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mechanical-symp...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.