Setting up SpeedUp (on Mac)

Hi @tt_su can you help?

I have so far managed to install SpeedUp GitHub - SketchUp/speedup: Profiling tool for SketchUp Ruby extensions. on Mac (21.1.331 and 22.0.253) but am not quite sure how to set-up the pre-defined tests (in the same way as TestUp).
By the way I made a PR on GitHub to suggest/request a few clarifications in the setup doc (README.md).

So I was able to run a profiling test directly from the console, in this format:
SpeedUp.profile { fibonacci(20) }
as per your example, and the dialog popped-up with the results, great! :smile:

However, when I try to set-up a pre-defined test case, creating a sub-class of SpeedUp::ProfileTest adding a menu item and calling SpeedUp.build_menus, I am getting nowhere, either with your example code or my own variant, I get the same:

Error: #<LoadError: cannot load such file -- <main>>
~/Library/Application Support/SketchUp 2021/SketchUp/Plugins/speedup/profile_test.rb:42:in `load'
~/Library/Application Support/SketchUp 2021/SketchUp/Plugins/speedup/profile_test.rb:42:in `reload'
~/Library/Application Support/SketchUp 2021/SketchUp/Plugins/speedup/profile_test.rb:52:in `run'
~/Library/Application Support/SketchUp 2021/SketchUp/Plugins/speedup/discoverer.rb:17:in `block (3 levels) in build_menus'

Is there something else that needs to be set-up?

thanks
Dave

If you look at the reload method in "https://github.com/SketchUp/speedup/blob/main/src/speedup/profile_test.rb"

You’ll see that it is trying to load a filename based upon searching your test case for any method whose name begins with the substring "profile_" and then getting the source_location which is the path from which your test case file is loaded.

This means that you cannot copy and paste the your profile test into the Ruby console. When this is done (ie, any code object is pasted into the console,) the source_location method just returns Ruby’s interpreter main function as the source location.

2 Likes

Aha, thanks Dan! Yes I do have a habit of pasting code to test it before saving, so that is the explanation, seems so obvious in retrospect!

1 Like

If you can log a ticket in the repo’s issue tracker that’d be good, making sure we remember to update the docs for this. The profile tests are very much WIP that’s rough around the corners.

I do have a public repo where I used SpeedUp for profiling and benchmarking; GitHub - thomthom/bitmap-2-mesh: Convert bitmaps to meshes in SketchUp

Might be a useful reference until we get the feature and docs improved.

1 Like

Thanks ThomThom. I made an issue on Github.
Would you be able to give any guidance on interpreting the results?
I’m a bit reluctant to post much in the way of internal workings on here, although might be happy to share in another dev forum/space.

Yea. (Though beware things are very busy these immediate days.)