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

Dispatch profiling #1621

Merged
merged 8 commits into from
Jun 24, 2024
Merged

Conversation

housel
Copy link
Member

@housel housel commented Jun 23, 2024

These changes fix dispatch profiling, make it more usable in practice, and document how to use it.

* sources/lib/dispatch-profiler/dispatch-profiler.dylan
  (print-dispatch-statistics): Remove a whitespace-stripping
   workaround for a problem with the pentium-dw command parser.
* sources/dfmc/modeling/functions.dylan
  (&class <profiling-call-site-cache-header-engine-node>): Declare the
   count slots for profiling cache-header engine nodes as
   <raw-machine-word> to reflect the way they are used in generated code.

* sources/dfmc/llvm-back-end/llvm-entry-points.dylan
  (entry-point-descriptor profiling-cache-header): Remove a "todo"
   comment about making the change above.
* sources/dylan/discrimination.dylan
  (compute-terminal-engine-node): Change the initialization order of
   profiling cache header engine nodes so that the generic function
   is available to the primitive-initialize-engine-node implementation
   (via the cache-header-engine-node-parent slot).
* sources/dylan/new-dispatch.dylan
  (make-linear-class-keyed-discriminator): Initialize lckd-hits
   in newly instantiated <linear-class-keyed-discriminator> nodes.
  (linear-class-key-lookup): Increment lckd-hits when the class is
   found.
  (make-linear-singleton-discriminator): Initialize lsd-hits in newly
   instantiated <linear-singleton-discriminator> nodes.
  (immediate-linear-singleton-discriminator-element): Increment
   lsd-hits when the matching instance is found.
  (value-object-linear-singleton-discriminator-element): Increment
   lsd-hits when the matching instance is found.
* sources/lib/dispatch-profiler/dispatch-profiler.dylan
  (with-dispatch-profiling-report): New macro for performing dynamic
   dispatch profiling on a block of code and printing out a summary
   report after execution completes.

* sources/lib/dispatch-profiler/dispatch-profiler-library.dylan
  (module dispatch-profiler): Export the
   with-dispatch-profiling-report macro.
* documentation/source/library-reference/dispatch-profiler/index.rst:
  New documentation source.

* documentation/source/library-reference/index.rst: Add the
  dispatch-profiler to the Library Reference.
* sources/lib/dispatch-profiler/walk-dispatch.dylan
  (with-preserved-dispatch-walking-types): Comment out this currently
   unused macro definition.
@housel housel force-pushed the dispatch-profiling-arcana branch from 1aa5350 to 114b29c Compare June 24, 2024 04:48
@housel housel merged commit e4e7d91 into dylan-lang:master Jun 24, 2024
2 of 3 checks passed
@housel housel deleted the dispatch-profiling-arcana branch June 24, 2024 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants