Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize tracing #16

Open
2 of 9 tasks
Tracked by #15
LinqLover opened this issue Jan 23, 2022 · 0 comments
Open
2 of 9 tasks
Tracked by #15

Optimize tracing #16

LinqLover opened this issue Jan 23, 2022 · 0 comments
Labels
engineering Technical change to the machinery

Comments

@LinqLover
Copy link
Collaborator

LinqLover commented Jan 23, 2022

Current bottlenecks during tracing are:

  • TDBTrace>>#maxTimeIndex (42%) - cache?
  • TDBTrace>>#traceAtTime:ifAbsent: (39%) - inline binary search? don't use #associations.

Remaining potential for optimization:

  • SimulationContext>>#customize: (1.7%) - hard-code relevant subset of copyFrom:
  • TDBMemory>>#object:priorTo:atSlot:put: (19.4%) - avoid thisContext, anything else?
  • TDBTrace>>#updateMaxTimeIndex:from: (7.5%)
  • TDBTrace>>#traceAtTime:ifAbsent: (18.4%) - single index for all traces?
  • TDBTrace>>#enableSimulatorDuring:: Currently, we are customizing all contexts there, which makes every forward-step in a large tree an expensive operation. Would it be fine only to customize the top context instead? Or could we at least exclude dead contexts (this would still be an optimization from O(n) to O(√n))?

Ideas for reducing space consumption:

  • Use dense table memory layout for certain objects/slots (i.e., Context/pc)?
  • Reduce default size of TDBTrace.children? Currently, over 90% of all trace instances do have 2 children or less:
    sizes := self cursor rootTrace withAllDescendants contents collect: [:t | t children size] as: Bag.
    sizes openAsMorph.
    (sizes count: [:size | size <= 2] ) / sizes size asFloat.
    image
@LinqLover LinqLover added the engineering Technical change to the machinery label Jan 23, 2022
This was referenced Jan 23, 2022
LinqLover added a commit that referenced this issue Jan 26, 2022
Many detailed optimizations that address #16 and #17. Contributes to #15.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engineering Technical change to the machinery
Projects
None yet
Development

No branches or pull requests

1 participant