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

Update README.md #5

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ This is a profiling tool for SketchUp Ruby extensions. It wraps [`Benchmark`](ht

![Profiling in SketchUp](docs/images/profiling.png)

## Installation
There is no RBZ file! Download the ZIP archive of the code from https://github.com/SketchUp/speedup/archive/refs/heads/main.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would encourage to clone the repo instead of downloading it.

Though, we should start adding RBZ files for each release.

Inside you will find the `src` folder, this contains the extension structure (`speedup.rb` and `speedup` folder). Manually drop those into your SketchUp Plugins folder(s) and restart SU.

## UI
The extension adds a new sub-menu at:
`Extensions > Developer > SpeedUp` (From SketchUp 2021.1)
`Extensions > SpeedUp` (Before SketchUp 2021.1)

## Setup

[RubyProf](https://github.com/ruby-prof/ruby-prof) is a gem that needs to be compiled as it's installed. This prevents it from being installed from within SketchUp under Windows. To compile gems you need the [Ruby DevKit](https://rubyinstaller.org/add-ons/devkit.html) to be configured for the compiler.
Expand All @@ -14,10 +23,16 @@ Additionally the gem started misbehaving in SketchUp 2017 and up. The profiler i

To make it easier for SketchUp extension developers this extension bundles pre-compiled versions of RubyProf and will attempt to install it into SketchUp's gems directory.

To initialise this process, you need to run the `Setup` command from the sub-menu at:
`Extensions > Developer > SpeedUp > Setup` (From SketchUp 2021.1)

`Extensions > SpeedUp > Setup` (Before SketchUp 2021.1)

If you have not run setup, you will see something like this in the Ruby Console:
```
Warning: SpeedUp was unable to activate the ruby-prof gem.
Warning: SpeedUp was unable to load ruby-prof
```

### Compatibility / Version Chart

| SketchUp | Ruby | ruby-prof (Win) | ruby-prof (Mac) |
Expand Down Expand Up @@ -114,4 +129,4 @@ def fibonacci(number)
end

SpeedUp.profile { fibonacci(20) }
```
```
6 changes: 5 additions & 1 deletion src/speedup/profile_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def self.reload
random_profile_method = self.instance_methods.grep(/^profile_/).first
path = self.instance_method(random_profile_method).source_location.first
$VERBOSE = nil
load path
if File.exist?(path)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would you run into this?

load path
else
UI.messagebox("Method '#{random_profile_method}' could not be loaded from path #{path.inspect}. Was the code pasted into the Ruby Console?")
end
ensure
$VERBOSE = original_verbose
end
Expand Down