Skip to content

Add --enable-trace-log install option#832

Merged
ohler55 merged 1 commit intoohler55:developfrom
Watson1978:trace
Jan 9, 2023
Merged

Add --enable-trace-log install option#832
ohler55 merged 1 commit intoohler55:developfrom
Watson1978:trace

Conversation

@Watson1978
Copy link
Copy Markdown
Collaborator

I think the trace log feature is for debugging and most people don't use it. Therefore, I usually want to improve performance by removing unnecessary instructions.

before after result
Oj.dump 1.440M 1.697M 1.178x

Environment

  • Linux
    • Manjaro Linux x86_64
    • Kernel: 6.1.1-1-MANJARO
    • AMD Ryzen 7 5800H
    • gcc version 12.2.0
    • Ruby 3.2.0

Before

Warming up --------------------------------------
             Oj.dump   142.510k i/100ms
Calculating -------------------------------------
             Oj.dump      1.440M (± 0.4%) i/s -     14.536M in  10.091795s

After

Warming up --------------------------------------
             Oj.dump   165.140k i/100ms
Calculating -------------------------------------
             Oj.dump      1.697M (± 0.7%) i/s -     17.009M in  10.025122s

Test code

require 'benchmark/ips'
require 'oj'

data = [[1,2,3,4,5]]*10

Benchmark.ips do |x|
  x.time = 10

  x.report('Oj.dump') do
    Oj.dump(data)
  end
end

@Watson1978 Watson1978 marked this pull request as draft January 8, 2023 23:45
I think the trace log feature is for debugging and most people don't use it.
Therefore, I usually want to improve performance by removing unnecessary instructions.

−       | before | after  | result
--       | --     | --     | --
Oj.dump  | 1.440M | 1.697M | 1.178x

### Environment
- Linux
  - Manjaro Linux x86_64
  - Kernel: 6.1.1-1-MANJARO
  - AMD Ryzen 7 5800H
  - gcc version 12.2.0
  - Ruby 3.2.0

### Before
```
Warming up --------------------------------------
             Oj.dump   142.510k i/100ms
Calculating -------------------------------------
             Oj.dump      1.440M (± 0.4%) i/s -     14.536M in  10.091795s
```

### After
```
Warming up --------------------------------------
             Oj.dump   165.140k i/100ms
Calculating -------------------------------------
             Oj.dump      1.697M (± 0.7%) i/s -     17.009M in  10.025122s
```

### Test code
```ruby
require 'benchmark/ips'
require 'oj'

data = [[1,2,3,4,5]]*10

Benchmark.ips do |x|
  x.time = 10

  x.report('Oj.dump') do
    Oj.dump(data)
  end
end
```
@Watson1978 Watson1978 marked this pull request as ready for review January 8, 2023 23:48
@ohler55
Copy link
Copy Markdown
Owner

ohler55 commented Jan 8, 2023

I agree, it is rarely used to having a compile options makes sense.

@ohler55 ohler55 merged commit 8a1773d into ohler55:develop Jan 9, 2023
@Watson1978 Watson1978 deleted the trace branch January 9, 2023 00:03
Watson1978 added a commit to Watson1978/oj that referenced this pull request Apr 16, 2023
I forgot to change these when I was add `-enable-trace-log` install option at ohler55#832.
ohler55 pushed a commit that referenced this pull request Apr 16, 2023
I forgot to change these when I was add `-enable-trace-log` install option at #832.
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