UI demo performance, GC

Nick Forde nickf at cadence.com
Wed Mar 21 06:35:13 PDT 2007


Timmy Douglas wrote:
> Brian Rice <water at tunes.org> writes:
>> Note that it uses Squeak-style forwarding pointers which is not the  
>> same as Lee's choice of card-marking as a scheme for GC. Card-marking  
>> does have its advantages (which can be found with a little research).  
>> Mostly I wrote it as an exercise in comparing Pidgin vs. Slang, the C- 
>> like dialects for VM implementation.
> 
> thanks. I'll take a look at it after I learn some more about GCs.

Hi Timmy,

Note that you can measure relative performance changes by
running the benchmarks in 'tests/benchmark':

$ make benchmark

To build a performance profile for these tests use:

$ make PROFILE=1 benchmark
$ gprof vm gmon.out

I've attached the output for this on my machine. You'll
notice that in this case the GC is less of a performance
bottleneck than in the SDL demo.

Have fun!

Nick.



-------------- next part --------------
Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total           
 time   seconds   seconds    calls  Ks/call  Ks/call  name    
 32.58    476.44   476.44 4107412175     0.00     0.00  ObjectPointer_dispatchTo_arity_above_
 26.40    862.62   386.18        1     0.39     1.46  PSInterpreter_interpret
 10.58   1017.39   154.77 3022879303     0.00     0.00  PSRoleTable_hashEntryForName_
  9.24   1152.58   135.19 4107276544     0.00     0.00  ObjectPointer_checkMethodCacheOn_arity_
  5.66   1235.32    82.74 4107275464     0.00     0.00  PSInterpreter_send_to_through_arity_withOptionals_
  5.17   1310.99    75.67 2106876238     0.00     0.00  PSInterpreter_apply_to_arity_withOptionals_
  2.21   1343.33    32.34 3023505396     0.00     0.00  PSObjectHeap_specialAt_
  2.02   1372.82    29.49 2105910200     0.00     0.00  PSInterpreter_returnFrom_withResult_
  0.92   1386.25    13.43 606924480     0.00     0.00  PSMethodDefinition_cacheAs_on_arity_
  0.81   1398.08    11.83 95637759     0.00     0.00  PSObjectHeap_markAndPushSlotsOf_
  0.65   1407.54     9.46 473084082     0.00     0.00  _prim37_LessThan
  0.30   1411.98     4.44 260769886     0.00     0.00  _prim13_atSlotNamed_
  0.30   1416.38     4.40 306310272     0.00     0.00  PSObjectHeap_allocateChunkSized_withPayload_
  0.26   1420.12     3.74 225682907     0.00     0.00  _prim43_Plus
  0.25   1423.72     3.60  2232857     0.00     0.00  PSObjectHeap_findNextLive
  0.23   1427.13     3.41 81847693     0.00     0.00  _prim46_quo_
  0.20   1430.09     2.96 164149689     0.00     0.00  _prim36_Equals
  0.18   1432.68     2.59 189162797     0.00     0.00  PSObjectHeap_clone_
  0.17   1435.15     2.47 120205884     0.00     0.00  _prim42_bitShift_
  0.16   1437.50     2.35 264501790     0.00     0.00  PSSlotTable_hashEntryForName_
  0.16   1439.84     2.34 80127460     0.00     0.00  _prim90_Minus
  0.14   1441.96     2.12 112548814     0.00     0.00  _prim26_applyTo_
  0.14   1444.04     2.08 117753461     0.00     0.00  PSObjectHeap_cloneOopArray_sized_
  0.14   1446.12     2.08 108384693     0.00     0.00  _prim44_Minus
  0.13   1447.98     1.86 105108294     0.00     0.00  _prim88_LessThan
  0.11   1449.61     1.63 31716237     0.00     0.00  _prim89_Plus
  0.10   1451.01     1.40  2232857     0.00     0.00  PSObjectHeap_findNextFree
  0.09   1452.34     1.33 53219691     0.00     0.00  _prim45_Times
  0.08   1453.49     1.15 307107457     0.00     0.00  PSObjectHeap_newIdentityHash
  0.08   1454.60     1.11 31787098     0.00     0.00  _prim19_byteAt_
  0.07   1455.66     1.06 21220129     0.00     0.00  _prim92_DivideBy
  0.07   1456.66     1.00 43995061     0.00     0.00  _prim24_at_put_
  0.07   1457.62     0.96 47216711     0.00     0.00  _prim39_bitAnd_
  0.06   1458.54     0.92 33751522     0.00     0.00  _prim91_Times
  0.06   1459.39     0.85 50917343     0.00     0.00  _prim23_at_
  0.06   1460.24     0.85 21539549     0.00     0.00  _prim86_withSignificand_exponent_
  0.05   1460.98     0.74 20472284     0.00     0.00  _prim20_byteAt_put_
  0.03   1461.35     0.37       35     0.00     0.00  PSObjectHeap_remapOops
  0.02   1461.71     0.36 18915178     0.00     0.00  PSObjectHeap_remapOop_
  0.01   1461.86     0.15 14847222     0.00     0.00  _prim41_bitNot
  0.01   1462.00     0.14      870     0.00     0.00  PSObjectHeap_markAndTrace
  0.01   1462.12     0.12   355779     0.00     0.00  PSObjectHeap_pinCards
  0.01   1462.23     0.11  5120070     0.00     0.00  _prim38_bitOr_
  0.00   1462.30     0.07   772365     0.00     0.00  _prim7_cloneSettingSlots_to_
  0.00   1462.36     0.06  1497573     0.00     0.00  _prim15_atSlotNamed_put_
  0.00   1462.41     0.05  2233620     0.00     0.00  PSObjectHeap_sweep
  0.00   1462.44     0.03  6082180     0.00     0.00  PWord_copyWords_into_
  0.00   1462.47     0.03  1710152     0.00     0.00  _prim22_size
  0.00   1462.50     0.03   431736     0.00     0.00  PSInterpreter_dispatchOptionals_
  0.00   1462.52     0.02        2     0.00     0.00  PSObjectHeap_compact_
  0.00   1462.53     0.01   273444     0.00     0.00  _prim34_identityHash
  0.00   1462.54     0.01   135537     0.00     0.00  _prim21_newSize_
  0.00   1462.55     0.01   122676     0.00     0.00  _prim76_atEndOf_
  0.00   1462.56     0.01   122676     0.00     0.00  endOfFile
  0.00   1462.57     0.01    63154     0.00     0.00  _prim72_read_from_into_startingAt_
  0.00   1462.57     0.00   797185     0.00     0.00  PSObjectHeap_allocateChunkSized_
  0.00   1462.57     0.00   355139     0.00     0.00  PSObjectHeap_findHoleSized_
  0.00   1462.57     0.00   313791     0.00     0.00  _prim18_size
  0.00   1462.57     0.00   190982     0.00     0.00  PSObjectHeap_cloneByteArray_sized_
  0.00   1462.57     0.00   190971     0.00     0.00  _prim17_newSize_
  0.00   1462.57     0.00   166950     0.00     0.00  _prim40_bitXor_
  0.00   1462.57     0.00   135631     0.00     0.00  PSInterpreter_resendMessage_
  0.00   1462.57     0.00    98448     0.00     0.00  PSObjectHeap_adjustFieldsOf_by_
  0.00   1462.57     0.00    98448     0.00     0.00  PSObjectHeap_isFree_
  0.00   1462.57     0.00    98448     0.00     0.00  PSObjectHeap_objectAfter_
  0.00   1462.57     0.00    77036     0.00     0.00  _prim2__map
  0.00   1462.57     0.00    63154     0.00     0.00  readFile
  0.00   1462.57     0.00    31961     0.00     0.00  _prim6_clone
  0.00   1462.57     0.00    20005     0.00     0.00  _prim73_write_to_from_startingAt_
  0.00   1462.57     0.00    20005     0.00     0.00  writeFile
  0.00   1462.57     0.00    13041     0.00     0.00  PSInterpreter_branchKeyed_
  0.00   1462.57     0.00    12341     0.00     0.00  PSRoleTable_hashEntryForInsertingName_
  0.00   1462.57     0.00     9337     0.00     0.00  _prim25_ensure_
  0.00   1462.57     0.00     2376     0.00     0.00  PSSlotTable_hashEntryForInsertingName_
  0.00   1462.57     0.00     1741     0.00     0.00  PSObjectHeap_memoryStart
  0.00   1462.57     0.00     1204     0.00     0.00  _prim27_sendTo_
  0.00   1462.57     0.00      923     0.00     0.00  PSRoleTable_emptySpace
  0.00   1462.57     0.00      923     0.00     0.00  PSRoleTable_growBy_excluding_
  0.00   1462.57     0.00      923     0.00     0.00  PSRoleTable_minimumCapacityAccommodating_
  0.00   1462.57     0.00      919     0.00     0.00  _prim35_identityHash
  0.00   1462.57     0.00      870     0.00     0.00  PSObjectHeap_clearCards
  0.00   1462.57     0.00      870     0.00     0.00  PSObjectHeap_garbageCollect
  0.00   1462.57     0.00      870     0.00     0.00  PSObjectHeap_markAndPushRoots
  0.00   1462.57     0.00      839     0.00     0.00  PSObject_addRoleNamed_at_dispatching_
  0.00   1462.57     0.00      789     0.00     0.00  ObjectPointer_flushMethodCache
  0.00   1462.57     0.00      786     0.00     0.00  ObjectPointer_asMethod_on_arity_
  0.00   1462.57     0.00      564     0.00     0.00  _prim65_write_to_from_startingAt_
  0.00   1462.57     0.00      497     0.00     0.00  _prim1_asAccessor_for_on_
  0.00   1462.57     0.00      414     0.00     0.00  PSSlotTable_emptySpace
  0.00   1462.57     0.00      414     0.00     0.00  PSSlotTable_growBy_excluding_
  0.00   1462.57     0.00      414     0.00     0.00  PSSlotTable_minimumCapacityAccommodating_
  0.00   1462.57     0.00      414     0.00     0.00  PSSlotTable_relocateAll_above_by_
  0.00   1462.57     0.00      414     0.00     0.00  _prim16_forwardTo_
  0.00   1462.57     0.00      365     0.00     0.00  PSObject_hasRoleNamed_at_dispatching_
  0.00   1462.57     0.00      289     0.00     0.00  _prim0_asMethod_on_
  0.00   1462.57     0.00      277     0.00     0.00  ObjectPointer_isMethod_on_arity_
  0.00   1462.57     0.00      217     0.00     0.00  PSObjectHeap_forward_to_
  0.00   1462.57     0.00      217     0.00     0.00  PSObject_addSlotNamed_valued_
  0.00   1462.57     0.00      217     0.00     0.00  PSObject_addSlotNamed_valued_at_
  0.00   1462.57     0.00      217     0.00     0.00  _prim8_cloneWithSlot_valued_
  0.00   1462.57     0.00      197     0.00     0.00  PSObject_addDelegateNamed_valued_
  0.00   1462.57     0.00      197     0.00     0.00  PSObject_addDelegateNamed_valued_at_
  0.00   1462.57     0.00      197     0.00     0.00  _prim9_cloneWithDelegate_valued_
  0.00   1462.57     0.00      186     0.00     0.00  _prim87_Equals
  0.00   1462.57     0.00      166     0.00     0.00  PSInterpreter_signal_on_arity_withOptionals_
  0.00   1462.57     0.00      166     0.00     0.00  PSInterpreter_signal_with_with_
  0.00   1462.57     0.00      128     0.00     0.00  _prim29_findOn_
  0.00   1462.57     0.00       92     0.00     0.00  _prim84_significand
  0.00   1462.57     0.00       92     0.00     0.00  _prim85_exponent
  0.00   1462.57     0.00       84     0.00     0.00  PSObject_removeRoleNamed_dispatching_
  0.00   1462.57     0.00       66     0.00     0.00  _prim71_close_
  0.00   1462.57     0.00       66     0.00     0.00  allocateFile
  0.00   1462.57     0.00       66     0.00     0.00  closeFile
  0.00   1462.57     0.00       66     0.00     0.00  extractCString
  0.00   1462.57     0.00       66     0.00     0.00  openFile
  0.00   1462.57     0.00       52     0.00     0.00  _prim115_primitiveApply_accepting_callFormat_returning_to_
  0.00   1462.57     0.00       52     0.00     0.00  applyExternalLibraryPrimitive
  0.00   1462.57     0.00       43     0.00     0.00  _prim68_handleForInput_
  0.00   1462.57     0.00       41     0.00     0.00  _prim14_atSlotNamed_
  0.00   1462.57     0.00       40     0.00     0.00  _prim3__map_
  0.00   1462.57     0.00       38     0.00     0.00  _prim66_flushOutput
  0.00   1462.57     0.00       36     0.00     0.00  _prim94_ln
  0.00   1462.57     0.00       21     0.00     0.00  _prim67_handleFor_
  0.00   1462.57     0.00       21     0.00     0.00  _prim74_reposition_to_
  0.00   1462.57     0.00       21     0.00     0.00  _prim75_positionOf_
  0.00   1462.57     0.00       21     0.00     0.00  seekFile
  0.00   1462.57     0.00       21     0.00     0.00  tellFile
  0.00   1462.57     0.00       13     0.00     0.00  _prim28_sendTo_through_
  0.00   1462.57     0.00       13     0.00     0.00  _prim53_collectGarbage
  0.00   1462.57     0.00       11     0.00     0.00  injectBigInteger
  0.00   1462.57     0.00       10     0.00     0.00  _prim54_bytesPerWord
  0.00   1462.57     0.00       10     0.00     0.00  safe_string
  0.00   1462.57     0.00        7     0.00     0.00  _prim113_primitiveLookup_handle_into_
  0.00   1462.57     0.00        7     0.00     0.00  lookupExternalLibraryPrimitive
  0.00   1462.57     0.00        6     0.00     0.00  _prim64_read_from_into_startingAt_
  0.00   1462.57     0.00        4     0.00     0.00  PSInterpreter_growStack
  0.00   1462.57     0.00        4     0.00     0.00  PSObjectHeap_growBy_
  0.00   1462.57     0.00        4     0.00     0.00  PSObjectHeap_initializeWithFirstFreeAt_
  0.00   1462.57     0.00        4     0.00     0.00  growMemoryBy
  0.00   1462.57     0.00        3     0.00     0.00  _prim111_primitiveOpen_handle_
  0.00   1462.57     0.00        3     0.00     0.00  openExternalLibrary
  0.00   1462.57     0.00        2     0.00     0.00  _prim70_handleForNew_
  0.00   1462.57     0.00        1     0.00     0.00  PSObjectHeap_adjustAllOopsBy_
  0.00   1462.57     0.00        1     0.00     0.00  PSObjectHeap_firstObject
  0.00   1462.57     0.00        1     0.00     0.00  PSObjectHeap_initializeCollector
  0.00   1462.57     0.00        1     0.00     0.00  PSObjectHeap_initializeWithShift_
  0.00   1462.57     0.00        1     0.00     0.00  _prim112_primitiveClose_
  0.00   1462.57     0.00        1     0.00     0.00  _prim31_runArgsInto_
  0.00   1462.57     0.00        1     0.00     0.00  _prim32_exit
  0.00   1462.57     0.00        1     0.00     0.00  _prim5_removeFrom_
  0.00   1462.57     0.00        1     0.00     0.00  _prim82_primitiveGetCurrentDirectory_
  0.00   1462.57     0.00        1     0.00     0.00  closeExternalLibrary
  0.00   1462.57     0.00        1     0.00     0.00  getCurrentDirectory
  0.00   1462.57     0.00        1     0.00     0.00  initDirectoryModule
  0.00   1462.57     0.00        1     0.00     0.00  initFileModule
  0.00   1462.57     0.00        1     0.00     0.00  initMemoryModule
  0.00   1462.57     0.00        1     0.00     0.00  initModules
  0.00   1462.57     0.00        1     0.00     1.46  slateMain
  0.00   1462.57     0.00        1     0.00     0.00  writeArgsInto


More information about the Slate mailing list