{"id":16143589,"url":"https://github.com/skunkworker/jruby_activerecord_checkout_regression","last_synced_at":"2025-04-06T19:26:35.768Z","repository":{"id":219845539,"uuid":"750078072","full_name":"skunkworker/jruby_activerecord_checkout_regression","owner":"skunkworker","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-30T16:24:56.000Z","size":3482,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T01:34:12.806Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skunkworker.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-30T00:02:20.000Z","updated_at":"2024-01-30T00:02:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"74c2887b-95df-451e-8817-aa34226e6a2e","html_url":"https://github.com/skunkworker/jruby_activerecord_checkout_regression","commit_stats":null,"previous_names":["skunkworker/jruby_activerecord_checkout_regression"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skunkworker%2Fjruby_activerecord_checkout_regression","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skunkworker%2Fjruby_activerecord_checkout_regression/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skunkworker%2Fjruby_activerecord_checkout_regression/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skunkworker%2Fjruby_activerecord_checkout_regression/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skunkworker","download_url":"https://codeload.github.com/skunkworker/jruby_activerecord_checkout_regression/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247537563,"owners_count":20954970,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T00:09:38.336Z","updated_at":"2025-04-06T19:26:35.748Z","avatar_url":"https://github.com/skunkworker.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JRuby ActiveRecord connection checkout regression\n\nThis repo is to demonstrate a performance regression observed when using Rails 6.1 with JRuby 9.3 (and the associated active record jdbc postgres library)\n\nAn example database `largedb` is generated using the included ruby script `./generate_largedb_schema.rb` which generates a schema with a table called `things` with 200 columns, and 15 other tables with 100 columns each.\n\nThe JRuby version is locked to `9.3.13.0`, but MRI `2.7.8`,`3.1.4` and `3.3.0` are used as counter examples for Rails 6.1.\n\nOnly log level = `info` is used for regular testing.\n\nNOTE: There is an interesting performance hit observed when using `log_level=:debug` and Rails 6.1 with JRuby that is not present in any other version.\n\n# Variables (see bench.sh for configuration)\n\n| Name | Set Value | Notes |\n| --- | --- | --- |\n| `DATABASE` | largedb | database to load schema into |\n| `RUNS_PER_LOOP` | 10 | the number of connection calls for the selected pool |\n| `LOOPS` | 10-10000 | The number of loops ran, each loop selects one pool |\n| `NUMBER_OF_POOLS` | 5 | The number of database pools to create | \n| `SCHEMA_COUNT` | 1-1000 | Sets the number of schemas to use (generated from `generate_largedb_schema.rb`) |\n\n# How to run\n\nRun `./bench.sh`\n\n# M1 MBP results\n\n```\nmacOS Sonoma 14.3\nPostgresql 13.13\nJDK-17\n```\n\nVariables\n\n```\nexport DATABASE=\"largedb\";\nexport RUNS_PER_LOOP=10;\nexport NUMBER_OF_POOLS=5;\nexport SCHEMA_COUNT=1000;\n```\n\n### JRuby -  Rails 4.2 \n| Run count | Time |\n| --- | --- |\n| 1000 | 4.09 |\n| 5000 | 7.11 |\n| 10000 | 9.68 |\n| 20000 | 14.0 |\n\n### JRuby -  Rails 6.1 with `databaseMetadataCacheFieldsMiB=2`\n| Run count | Time |\n| --- | --- |\n| 1000 | 21.54 |\n| 5000 | 103.09 |\n| 10000 | 201.32 |\n| 20000 | 356.61 |\n\n### JRuby - Rails 6.1 with `databaseMetadataCacheFieldsMiB=0`\n| Run count | Time |\n| --- | --- |\n| 1000 | 22.37 |\n| 5000 | 104.77 |\n| 10000 | 200.07 |\n| 20000 | 399.97 |\n\n### JRuby - Rails 6.1 with `databaseMetadataCacheFieldsMiB=5`\n| Run count | Time |\n| --- | --- |\n| 1000 | 17.56 |\n| 5000 | 74.41 |\n| 10000 | 147.27 |\n| 20000 | 281.73 |\n\n### Ruby 2.7.8 - Rails 6.1\n| Run count | Time |\n| --- | --- |\n| 1000 | 3.14 |\n| 5000 | 17.3 |\n| 10000 | 32.28 |\n| 20000 | 66.52 |\n\n### Ruby 3.1.4 - Rails 6.1\n| Run count | Time |\n| --- | --- |\n| 1000 | 2.7 |\n| 5000 | 14.44 |\n| 10000 | 29.42 |\n| 20000 | 58.74 |\n\n### Ruby 3.3.0 - Rails 6.1\n| Run count | Time |\n| --- | --- |\n| 1000 | 2.61 |\n| 5000 | 13.92 |\n| 10000 | 29.0 |\n| 20000 | 60.04 |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskunkworker%2Fjruby_activerecord_checkout_regression","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskunkworker%2Fjruby_activerecord_checkout_regression","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskunkworker%2Fjruby_activerecord_checkout_regression/lists"}