Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

perf(rome_cli): replace global allocator with jemalloc #3237

Merged
merged 2 commits into from
Sep 21, 2022
Merged

Conversation

ematipico
Copy link
Contributor

@ematipico ematipico commented Sep 16, 2022

Summary

This PR replaces the default global allocator to use jemallocator on all operative systems, exception for Windows because it's not supported.

Test Plan

Here's some benchmarks from my machine (I use macOS)

parser

group                                 jamalloc                               main
-----                                 --------                               ----
parser/checker.ts                     1.00     98.9±7.70ms    26.3 MB/sec    1.16    115.2±3.25ms    22.6 MB/sec
parser/compiler.js                    1.00     52.8±1.15ms    19.8 MB/sec    1.49     79.0±1.86ms    13.3 MB/sec
parser/d3.min.js                      1.00     34.2±2.76ms     7.7 MB/sec    1.22     41.9±0.96ms     6.3 MB/sec
parser/dojo.js                        1.00      3.1±0.24ms    22.2 MB/sec    1.16      3.6±0.09ms    19.2 MB/sec
parser/ios.d.ts                       1.00     76.2±3.42ms    24.5 MB/sec    1.33    101.1±5.28ms    18.5 MB/sec
parser/jquery.min.js                  1.00      8.4±0.70ms     9.8 MB/sec    1.40     11.8±0.25ms     7.0 MB/sec
parser/math.js                        1.00     68.2±6.90ms     9.5 MB/sec    1.21     82.7±1.39ms     7.8 MB/sec
parser/parser.ts                      1.00      2.2±0.18ms    22.1 MB/sec    1.13      2.5±0.07ms    19.6 MB/sec
parser/pixi.min.js                    1.00     43.2±1.93ms    10.2 MB/sec    1.33     57.4±1.07ms     7.6 MB/sec
parser/react-dom.production.min.js    1.00     11.4±0.31ms    10.1 MB/sec    1.32     15.1±0.43ms     7.6 MB/sec
parser/react.production.min.js        1.00   618.1±75.15µs    10.0 MB/sec    1.31   810.4±21.71µs     7.6 MB/sec
parser/router.ts                      1.00  1744.8±96.27µs    35.2 MB/sec    1.23      2.1±0.08ms    28.6 MB/sec
parser/tex-chtml-full.js              1.00     92.9±5.44ms     9.8 MB/sec    1.21    112.5±6.80ms     8.1 MB/sec
parser/three.min.js                   1.00     51.7±7.25ms    11.4 MB/sec    1.15     59.4±1.29ms     9.9 MB/sec
parser/typescript.js                  1.00   381.1±29.09ms    24.9 MB/sec    1.25    478.1±8.76ms    19.9 MB/sec
parser/vue.global.prod.js             1.00     13.7±0.39ms     8.8 MB/sec    1.39     19.1±0.48ms     6.3 MB/sec

formatter

group                                    formatter-jamalloc                      formatter-main
-----                                    ------------------                      --------------
formatter/checker.ts                     1.00   360.2±11.12ms     7.2 MB/sec     1.99   718.7±88.40ms     3.6 MB/sec
formatter/compiler.js                    1.00   213.1±24.96ms     4.9 MB/sec     1.94   413.6±32.24ms     2.5 MB/sec
formatter/d3.min.js                      1.00    162.9±6.40ms  1647.7 KB/sec     2.14   348.4±24.40ms   770.3 KB/sec
formatter/dojo.js                        1.00     10.1±0.38ms     6.8 MB/sec     1.83     18.6±0.68ms     3.7 MB/sec
formatter/ios.d.ts                       1.00    224.4±7.34ms     8.3 MB/sec     2.09   469.8±52.19ms     4.0 MB/sec
formatter/jquery.min.js                  1.00     46.2±3.25ms  1830.6 KB/sec     1.88     86.9±4.87ms   973.9 KB/sec
formatter/math.js                        1.00   316.2±16.29ms     2.0 MB/sec     2.07   654.2±44.04ms  1013.5 KB/sec
formatter/parser.ts                      1.00      7.6±0.24ms     6.4 MB/sec     1.78     13.5±0.81ms     3.6 MB/sec
formatter/pixi.min.js                    1.00   182.9±20.46ms     2.4 MB/sec     2.04   372.9±26.13ms  1205.1 KB/sec
formatter/react-dom.production.min.js    1.00     53.6±3.05ms     2.1 MB/sec     2.16   115.6±16.34ms  1019.3 KB/sec
formatter/react.production.min.js        1.00      2.5±0.07ms     2.5 MB/sec     1.82      4.5±0.22ms  1385.1 KB/sec
formatter/router.ts                      1.00      6.0±0.37ms    10.2 MB/sec     1.65      9.9±0.51ms     6.2 MB/sec
formatter/tex-chtml-full.js              1.00   405.0±17.74ms     2.3 MB/sec     2.19   886.4±69.69ms  1052.8 KB/sec
formatter/three.min.js                   1.00   210.4±23.22ms     2.8 MB/sec     1.99   418.5±33.31ms  1436.6 KB/sec
formatter/typescript.js                  1.00  1444.9±154.91ms     6.6 MB/sec    1.67       2.4±0.10s     3.9 MB/sec
formatter/vue.global.prod.js             1.00     70.9±5.05ms  1740.0 KB/sec     2.07   146.9±13.28ms   839.9 KB/sec

analyzer

group                     analyzer-jamalloc                      analyzer-main
-----                     -----------------                      -------------
analyzer/css.js           1.00  1682.7±79.01µs     6.9 MB/sec    2.03      3.4±0.10ms     3.4 MB/sec
analyzer/index.js         1.00      4.5±0.08ms     7.2 MB/sec    2.43     10.9±0.36ms     3.0 MB/sec
analyzer/lint.ts          1.00      2.5±0.20ms    16.8 MB/sec    1.73      4.3±0.12ms     9.7 MB/sec
analyzer/parser.ts        1.00      5.8±0.28ms     8.4 MB/sec    1.84     10.7±0.18ms     4.6 MB/sec
analyzer/router.ts        1.00      4.0±0.14ms    15.4 MB/sec    1.85      7.4±0.10ms     8.3 MB/sec
analyzer/statement.ts     1.00      5.4±0.25ms     6.5 MB/sec    1.99     10.8±0.72ms     3.3 MB/sec
analyzer/typescript.ts    1.00      9.1±0.52ms     6.0 MB/sec    1.67     15.2±0.26ms     3.6 MB/sec

Memory consumption

I used cargo instruments and I am not an expert at using the trace tool provided by XCode. I share here the screenshots and the trace file in case someone has more knowledge than me.

I run the formatter on the prettier repository, their src folder. No --write.

jemalloc

Screenshot 2022-09-21 at 10 32 34

main

Screenshot 2022-09-21 at 10 32 29

@ematipico ematipico temporarily deployed to netlify-playground September 16, 2022 09:05 Inactive
@netlify
Copy link

netlify bot commented Sep 16, 2022

Deploy Preview for rometools canceled.

Name Link
🔨 Latest commit 3e557de
🔍 Latest deploy log https://app.netlify.com/sites/rometools/deploys/6329b07a02466a00094865a2

@github-actions
Copy link

Parser conformance results on ubuntu-latest

js/262

Test result main count This PR count Difference
Total 45879 45879 0
Passed 44939 44939 0
Failed 940 940 0
Panics 0 0 0
Coverage 97.95% 97.95% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 39 39 0
Passed 36 36 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.31% 92.31% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5946 5946 0
Passed 1621 1621 0
Failed 4325 4325 0
Panics 0 0 0
Coverage 27.26% 27.26% 0.00%

ts/babel

Test result main count This PR count Difference
Total 588 588 0
Passed 519 519 0
Failed 69 69 0
Panics 0 0 0
Coverage 88.27% 88.27% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 16257 16257 0
Passed 12395 12395 0
Failed 3862 3862 0
Panics 0 0 0
Coverage 76.24% 76.24% 0.00%

@github-actions
Copy link

github-actions bot commented Sep 16, 2022

@MichaReiser
Copy link
Contributor

Have you compared performance with mimalloc? Depending on different allocators for every platform increases the risk of platforms specific issues and requires us to test every change on every platform.

That's why I would prefer to use the default system allocator for all (maybe except windows) platforms or replace the default for all platforms.

@MichaReiser
Copy link
Contributor

You know... this will make it more difficult for me to prove that any of my work reducing allocation is any good :P

@IWANABETHATGUY
Copy link
Contributor

IWANABETHATGUY commented Sep 16, 2022

Would you mind explaining why replacing an allocator will make it harder to prove reducing allocation ?

Forgive me this stupid question.

@MichaReiser
Copy link
Contributor

MichaReiser commented Sep 16, 2022

Would you mind explaining why replacing an allocator will make it harder to prove reducing allocation ?

If every single allocations becomes cheaper than reducing the number of allocations has less effect on the overall performance.

@ematipico Would you mind also comparing the memory consumption? Do you have links that compare the different allocators?

@IWANABETHATGUY
Copy link
Contributor

Would you mind explaining why replacing an allocator will make it harder to prove reducing allocation ?

If every single allocations becomes cheaper than reducing the number of allocations has less effect on the overall performance.

@ematipico Would you mind also comparing the memory consumption? Do you have links that compare the different allocators?

Thanks

@ematipico ematipico marked this pull request as ready for review September 16, 2022 09:44
@ematipico ematipico requested a review from a team September 16, 2022 09:44
@leops
Copy link
Contributor

leops commented Sep 16, 2022

Depending on different allocators for every platform increases the risk of platforms specific issues and requires us to test every change on every platform.

Technically we are already depending on different allocators for different platforms, since we use whatever allocator is provided by the OS. I don't know if mimalloc compares favorably to jemalloc in terms of performance, as always with perfs this is something we need to benchmark with our workloads to be sure. In any case I think it would be interesting to use jemalloc on all Unix systems instead of just macOS and mimalloc on Windows, this way we would still smooth out most platform discrepancies by using the same allocator (almost) everywhere

Also, what's the impact of this change on the size of the rome binary ?

@MichaReiser
Copy link
Contributor

Depending on different allocators for every platform increases the risk of platforms specific issues and requires us to test every change on every platform.

Technically we are already depending on different allocators for different platforms, since we use whatever allocator is provided by the OS. I don't know if mimalloc compares favorably to jemalloc in terms of performance, as always with perfs this is something we need to benchmark with our workloads to be sure. In any case I think it would be interesting to use jemalloc on all Unix systems instead of just macOS and mimalloc on Windows, this way we would still smooth out most platform discrepancies by using the same allocator (almost) everywhere

Also, what's the impact of this change on the size of the rome binary ?

What was your reasoning why you preferred minmalloc over jemalloc?

@ematipico
Copy link
Contributor Author

ematipico commented Sep 16, 2022

The reason why I tried jemalloctor for macOS first was mainly because lighthingcss uses it (former ParcelCSS). And I gave it a try and see what's the result on our benches.

I will give it a whirl in terms of memory usages once I manage to download again all the necessary software. We can close it if you think it's not worth it.

@leops
Copy link
Contributor

leops commented Sep 16, 2022

What was your reasoning why you preferred minmalloc over jemalloc?

For Windows the reason was simply that tikv-jemallocator doesn't support it

@MichaReiser
Copy link
Contributor

The reason why I tried jemalloctor for macOS first was mainly because lighthingcss uses it (former ParcelCSS). And I gave it a try and see what's the result on our benches.

I will give it a whirl in terms of memory usages once I manage to download again all the necessary software. We can close it if you think it's not worth it.

The results seem very promising! My main concern is that I want to avoid having one custom allocator for every platform that we support. Using minmalloc for windows and jemallc for UNIX systems seems a reasonable balance between performance and too many configurations (even though I haven't seen any significant improvements on linux)

@ematipico
Copy link
Contributor Author

So, should we just switch to use this allocator for all the OS expect windows?

@MichaReiser
Copy link
Contributor

So, should we just switch to use this allocator for all the OS expect windows?

Probably. But it would still be interesting to get some more numbers:

  • How does it change performance results on linux
  • Is there a way for us to compare memory consumption before/after? If so, what are the numbers

@calibre-analytics
Copy link

calibre-analytics bot commented Sep 20, 2022

Comparing perf(rome_cli): replace global allocator with jemalloc for macos Snapshot #3 to median since last deploy of rome.tools.

LCP? CLS? TBT?
Overall
Median across all pages and test profiles
1.95s
from 559ms
0.0
no change
147ms
from 42ms
Chrome Desktop
Chrome Desktop • Cable
1.95s
from 586ms
0.0
no change
379ms
from 239ms
iPhone, 4G LTE
iPhone 12 • 4G LTE
1s
from 218ms
0.0
no change
3ms
from 6ms
Motorola Moto G Power, 3G connection
Motorola Moto G Power • Regular 3G
12.5s
from 559ms
0.0
no change
147ms
from 42ms

1 page tested

 Home

Browser previews

Chrome Desktop iPhone, 4G LTE Motorola Moto G Power, 3G connection
Chrome Desktop iPhone, 4G LTE Motorola Moto G Power, 3G connection

Most significant changes

Value Budget
JS Parse & Compile
Motorola Moto G Power, 3G connection
1.51s
from 29ms
JS Parse & Compile
iPhone, 4G LTE
458ms
from 9ms
Total JavaScript Size in Bytes
Chrome Desktop
4.11 MB
from 86.8 KB
Total JavaScript Size in Bytes
iPhone, 4G LTE
4.11 MB
from 86.8 KB
Total JavaScript Size in Bytes
Motorola Moto G Power, 3G connection
4.11 MB
from 86.8 KB

28 other significant changes: JS Parse & Compile on Chrome Desktop, First Contentful Paint on Motorola Moto G Power, 3G connection, Largest Contentful Paint on Motorola Moto G Power, 3G connection, Speed Index on Motorola Moto G Power, 3G connection, Total Page Size in Bytes on Chrome Desktop, Total Page Size in Bytes on iPhone, 4G LTE, Total Page Size in Bytes on Motorola Moto G Power, 3G connection, Number of Requests on Motorola Moto G Power, 3G connection, Number of Requests on Chrome Desktop, Number of Requests on iPhone, 4G LTE, Time to Interactive on Motorola Moto G Power, 3G connection, First Contentful Paint on Chrome Desktop, First Contentful Paint on iPhone, 4G LTE, Time to Interactive on Chrome Desktop, Speed Index on Chrome Desktop, Speed Index on iPhone, 4G LTE, Largest Contentful Paint on iPhone, 4G LTE, Time to Interactive on iPhone, 4G LTE, Total Blocking Time on Motorola Moto G Power, 3G connection, Largest Contentful Paint on Chrome Desktop, Total Image Size in Bytes on Chrome Desktop, Total Image Size in Bytes on iPhone, 4G LTE, Total Image Size in Bytes on Motorola Moto G Power, 3G connection, Total HTML Size in Bytes on Chrome Desktop, Total HTML Size in Bytes on iPhone, 4G LTE, Total HTML Size in Bytes on Motorola Moto G Power, 3G connection, Lighthouse Performance Score on Motorola Moto G Power, 3G connection, Lighthouse Performance Score on Chrome Desktop

Calibre: Site dashboard | View this PR | Edit settings | View documentation

@ematipico ematipico temporarily deployed to netlify-playground September 20, 2022 12:22 Inactive
@ematipico
Copy link
Contributor Author

!bench_formatter
!bench_parser
!bench_analyzer

@github-actions
Copy link

Analyzer Benchmark Results

group                     main                                   pr
-----                     ----                                   --
analyzer/css.js           1.24      2.4±0.10ms     4.8 MB/sec    1.00  1950.0±61.42µs     6.0 MB/sec
analyzer/index.js         1.13      6.4±0.25ms     5.1 MB/sec    1.00      5.7±0.25ms     5.7 MB/sec
analyzer/lint.ts          1.14      3.3±0.16ms    12.5 MB/sec    1.00      2.9±0.11ms    14.3 MB/sec
analyzer/parser.ts        1.19      8.1±0.29ms     6.0 MB/sec    1.00      6.8±0.30ms     7.1 MB/sec
analyzer/router.ts        1.14      5.6±0.22ms    10.9 MB/sec    1.00      4.9±0.21ms    12.5 MB/sec
analyzer/statement.ts     1.19      7.7±0.37ms     4.6 MB/sec    1.00      6.4±0.24ms     5.5 MB/sec
analyzer/typescript.ts    1.18     11.5±0.47ms     4.7 MB/sec    1.00      9.7±0.41ms     5.6 MB/sec

@github-actions
Copy link

Parser Benchmark Results

group                                 main                                   pr
-----                                 ----                                   --
parser/checker.ts                     1.00    138.5±7.97ms    18.8 MB/sec    1.07    148.7±6.96ms    17.5 MB/sec
parser/compiler.js                    1.01     86.3±4.56ms    12.1 MB/sec    1.00     85.3±3.41ms    12.3 MB/sec
parser/d3.min.js                      1.01     51.8±2.63ms     5.1 MB/sec    1.00     51.4±2.24ms     5.1 MB/sec
parser/dojo.js                        1.09      4.7±0.14ms    14.6 MB/sec    1.00      4.3±0.22ms    16.0 MB/sec
parser/ios.d.ts                       1.00    121.0±5.88ms    15.4 MB/sec    1.09    131.6±7.02ms    14.2 MB/sec
parser/jquery.min.js                  1.00     13.6±0.34ms     6.1 MB/sec    1.02     13.8±0.83ms     6.0 MB/sec
parser/math.js                        1.00     97.7±4.53ms     6.6 MB/sec    1.08    105.7±4.76ms     6.1 MB/sec
parser/parser.ts                      1.05      3.2±0.07ms    15.3 MB/sec    1.00      3.0±0.12ms    16.0 MB/sec
parser/pixi.min.js                    1.00     59.6±1.83ms     7.4 MB/sec    1.08     64.3±2.66ms     6.8 MB/sec
parser/react-dom.production.min.js    1.00     18.9±0.82ms     6.1 MB/sec    1.00     18.9±1.07ms     6.1 MB/sec
parser/react.production.min.js        1.09  1043.4±39.05µs     5.9 MB/sec    1.00   955.3±31.87µs     6.4 MB/sec
parser/router.ts                      1.09      2.8±0.11ms    22.2 MB/sec    1.00      2.5±0.07ms    24.2 MB/sec
parser/tex-chtml-full.js              1.00    133.1±5.81ms     6.8 MB/sec    1.08    143.5±5.55ms     6.4 MB/sec
parser/three.min.js                   1.00     69.6±3.73ms     8.4 MB/sec    1.02     70.7±3.03ms     8.3 MB/sec
parser/vue.global.prod.js             1.03     23.4±0.78ms     5.1 MB/sec    1.00     22.8±0.97ms     5.3 MB/sec

@github-actions
Copy link

Formatter Benchmark Results

group                                    main                                   pr
-----                                    ----                                   --
formatter/checker.ts                     1.18   600.8±12.45ms     4.3 MB/sec    1.00   509.4±14.16ms     5.1 MB/sec
formatter/compiler.js                    1.14   319.0±10.86ms     3.3 MB/sec    1.00    279.2±7.64ms     3.8 MB/sec
formatter/d3.min.js                      1.21   270.4±12.77ms   992.6 KB/sec    1.00    223.4±7.91ms  1201.2 KB/sec
formatter/dojo.js                        1.13     16.2±0.56ms     4.2 MB/sec    1.00     14.3±0.38ms     4.8 MB/sec
formatter/ios.d.ts                       1.10    342.2±8.24ms     5.5 MB/sec    1.00    310.8±8.04ms     6.0 MB/sec
formatter/jquery.min.js                  1.02     65.8±2.34ms  1285.4 KB/sec    1.00     64.3±2.20ms  1316.4 KB/sec
formatter/math.js                        1.18   532.1±12.71ms  1246.2 KB/sec    1.00    451.2±9.18ms  1469.7 KB/sec
formatter/parser.ts                      1.16     11.0±0.32ms     4.4 MB/sec    1.00      9.4±0.30ms     5.2 MB/sec
formatter/pixi.min.js                    1.17    299.9±9.00ms  1498.5 KB/sec    1.00    256.9±8.78ms  1749.6 KB/sec
formatter/react-dom.production.min.js    1.12     84.8±3.76ms  1390.5 KB/sec    1.00     75.5±2.53ms  1560.4 KB/sec
formatter/react.production.min.js        1.16      4.0±0.14ms  1568.5 KB/sec    1.00      3.5±0.09ms  1817.1 KB/sec
formatter/router.ts                      1.10      8.4±0.27ms     7.3 MB/sec    1.00      7.6±0.26ms     8.1 MB/sec
formatter/tex-chtml-full.js              1.19   689.1±20.88ms  1354.2 KB/sec    1.00   580.1±10.92ms  1608.6 KB/sec
formatter/three.min.js                   1.20   341.4±10.96ms  1760.9 KB/sec    1.00    284.7±8.25ms     2.1 MB/sec
formatter/typescript.js                  1.00       2.1±0.03s     4.5 MB/sec  
formatter/vue.global.prod.js             1.10    111.4±4.73ms  1107.3 KB/sec    1.00    101.7±5.72ms  1213.4 KB/sec

@MichaReiser
Copy link
Contributor

formatter/typescript.js 1.00 2.1±0.03s 4.5 MB/sec

Uhm, what happened with typescript?

@ematipico
Copy link
Contributor Author

ematipico commented Sep 21, 2022

formatter/typescript.js 1.00 2.1±0.03s 4.5 MB/sec

Uhm, what happened with typescript?

Something went wrong during the download of the file:

 "Status(520, Response[status: 520, status_text: , url: https://www.unpkg.com/typescript@4.5.5/lib/typescript.js])"

@ematipico
Copy link
Contributor Author

@rome/staff I updated the description of the issue with some findings around memory consumption.

Copy link
Contributor

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

I'm not sure if the allocation numbers are representative because they're only measuring how much memory was requested and freed by the system allocator which is expected to be less if you use a custom allocator that re-uses allocations before requesting new pages from the system allocator.

However, you shared some numbers over slack which are promising.

I checked with activity monitory. With jemalloc the memory usage is around 20MB top. main instead is 45MB top

I think the results overall are very promising and I verified them on my local machine. There are a few cases where performance regresses or does not improve, but the numbers greatly improve for all benchmarks traversing the CST.

group                                    jemalloc                               main
-----                                    --------                               ----
analyzer/css.js                          1.00  1026.2±11.93µs    11.3 MB/sec    1.24   1268.7±5.37µs     9.2 MB/sec
analyzer/index.js                        1.00      2.9±0.05ms    11.1 MB/sec    1.16      3.4±0.01ms     9.6 MB/sec
analyzer/lint.ts                         1.00   1541.7±7.90µs    27.0 MB/sec    1.16  1782.6±239.92µs    23.3 MB/sec
analyzer/parser.ts                       1.00      3.6±0.05ms    13.5 MB/sec    1.15      4.2±0.01ms    11.7 MB/sec
analyzer/router.ts                       1.00      2.4±0.02ms    25.4 MB/sec    1.23      3.0±0.01ms    20.7 MB/sec
analyzer/statement.ts                    1.00      3.3±0.06ms    10.9 MB/sec    1.30      4.2±0.01ms     8.4 MB/sec
analyzer/typescript.ts                   1.00      5.1±0.05ms    10.6 MB/sec    1.25      6.4±0.11ms     8.5 MB/sec
formatter/checker.ts                     1.00    220.9±1.81ms    11.8 MB/sec    1.15    253.8±4.23ms    10.2 MB/sec
formatter/compiler.js                    1.00    123.4±3.05ms     8.5 MB/sec    1.13    139.6±0.90ms     7.5 MB/sec
formatter/d3.min.js                      1.00    102.9±0.91ms     2.5 MB/sec    1.10    112.7±1.26ms     2.3 MB/sec
formatter/dojo.js                        1.00      6.7±0.02ms    10.2 MB/sec    1.16      7.8±0.03ms     8.8 MB/sec
formatter/ios.d.ts                       1.00    140.1±0.76ms    13.3 MB/sec    1.17    164.1±2.29ms    11.4 MB/sec
formatter/jquery.min.js                  1.00     28.9±0.34ms     2.9 MB/sec    1.10     31.8±0.85ms     2.6 MB/sec
formatter/math.js                        1.00    207.7±1.46ms     3.1 MB/sec    1.17    243.5±4.20ms     2.7 MB/sec
formatter/parser.ts                      1.00      4.7±0.02ms    10.4 MB/sec    1.13      5.3±0.07ms     9.3 MB/sec
formatter/pixi.min.js                    1.00    115.9±0.86ms     3.8 MB/sec    1.12    130.0±1.78ms     3.4 MB/sec
formatter/react-dom.production.min.js    1.00     34.8±0.13ms     3.3 MB/sec    1.12     39.1±0.38ms     2.9 MB/sec
formatter/react.production.min.js        1.00   1710.6±5.75µs     3.6 MB/sec    1.13   1940.7±8.91µs     3.2 MB/sec
formatter/router.ts                      1.00      3.7±0.02ms    16.8 MB/sec    1.13      4.1±0.05ms    14.9 MB/sec
formatter/tex-chtml-full.js              1.00    267.5±1.42ms     3.4 MB/sec    1.10    295.0±3.07ms     3.1 MB/sec
formatter/three.min.js                   1.00    129.2±0.59ms     4.5 MB/sec    1.11    143.5±0.84ms     4.1 MB/sec
formatter/typescript.js                  1.00   842.4±13.77ms    11.3 MB/sec    1.15   972.7±15.36ms     9.8 MB/sec
formatter/vue.global.prod.js             1.00     44.5±0.48ms     2.7 MB/sec    1.12     49.6±0.84ms     2.4 MB/sec
parser/checker.ts                        1.09     61.2±1.92ms    42.5 MB/sec    1.00     56.1±0.49ms    46.3 MB/sec
parser/compiler.js                       1.00     33.3±0.39ms    31.5 MB/sec    1.06     35.1±0.19ms    29.8 MB/sec
parser/d3.min.js                         1.00     21.6±0.75ms    12.1 MB/sec    1.01     21.7±0.07ms    12.1 MB/sec
parser/dojo.js                           1.00  1879.6±25.53µs    36.5 MB/sec    1.08      2.0±0.01ms    33.8 MB/sec
parser/ios.d.ts                          1.10     51.4±0.91ms    36.3 MB/sec    1.00     46.9±0.72ms    39.8 MB/sec
parser/jquery.min.js                     1.00      5.7±0.09ms    14.5 MB/sec    1.04      5.9±0.01ms    13.9 MB/sec
parser/math.js                           1.05     42.4±1.74ms    15.3 MB/sec    1.00     40.5±1.97ms    16.0 MB/sec
parser/parser.ts                         1.00  1311.6±11.85µs    37.1 MB/sec    1.10  1444.8±12.49µs    33.7 MB/sec
parser/pixi.min.js                       1.05     26.6±0.52ms    16.5 MB/sec    1.00     25.4±0.09ms    17.2 MB/sec
parser/react-dom.production.min.js       1.00      7.9±0.04ms    14.6 MB/sec    1.00      7.9±0.07ms    14.6 MB/sec
parser/react.production.min.js           1.00    386.0±5.42µs    15.9 MB/sec    1.12   433.3±16.39µs    14.2 MB/sec
parser/router.ts                         1.00  1108.6±12.05µs    55.4 MB/sec    1.10  1214.3±23.91µs    50.6 MB/sec
parser/tex-chtml-full.js                 1.10     58.7±1.90ms    15.5 MB/sec    1.00     53.4±0.21ms    17.1 MB/sec
parser/three.min.js                      1.06     30.9±1.11ms    19.0 MB/sec    1.00     29.1±0.06ms    20.2 MB/sec
parser/typescript.js                     1.03    240.5±2.73ms    39.5 MB/sec    1.00   234.5±17.22ms    40.5 MB/sec
parser/vue.global.prod.js                1.00      9.9±0.16ms    12.2 MB/sec    1.00      9.9±0.03ms    12.2 MB/sec

@ematipico ematipico added this to the 0.10.0 milestone Sep 21, 2022
@ematipico ematipico added the A-Core Area: core label Sep 21, 2022
@ematipico ematipico changed the title perf(rome_cli): replace global allocator with jemalloc for macos perf(rome_cli): replace global allocator with jemalloc Sep 21, 2022
@ematipico ematipico added the A-CLI Area: CLI label Sep 21, 2022
@ematipico
Copy link
Contributor Author

ematipico commented Sep 21, 2022

@leops and @xunilrj what do you think? The numbers seem good and so far I could not see any issue locally. Should we make the switch to jemalloc for all operative systems? (exception for windows)

@ematipico ematipico merged commit 806de56 into main Sep 21, 2022
@ematipico ematipico deleted the perf/jamalloc branch September 21, 2022 14:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-CLI Area: CLI A-Core Area: core
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants