Title | Scheme interpreter running test-leaf has poor CPU utilization |
Status | suspended |
Priority | essential |
Assigned user | Gareth Rees |
Organization | Ravenbrook |
Description | Compile scheme-advanced in Xcode and profile it using Instruments. * Using josephus.scm, we see wall-clock time of 8 seconds, of which 7.8 seconds (97%) is assignable to the Main Thread by the profiler. * Using test-leaf.scm, we see wall-clock time of 16 seconds, of which 0.123 seconds (<1%) is assignable to the Main Thread by the profiler, and 0.180 seconds (~1%) is assignable to the protCatchThread. |
Analysis | It looks as if Instruments (1) scans the call stack each time it gets a sample and (2) abandons the current sample if it is not complete when the time comes to start the next sample. So when the stack is very large (as it is, deliberately, in test-leaf) and the sample interval is small (the default is 1ms) Instruments nearly always fails to complete its sample. |
How found | manual_test |
Evidence | None as yet. |
Created by | Gareth Rees |
Created on | 2014-02-20 16:44:54 |
Last modified by | Gareth Rees |
Last modified on | 2014-02-21 14:12:41 |
History | 2014-02-20 GDR Created. 2014-02-21 GDR Suspended; see analysis. |