Ruby China
  • 社区
  • 招聘
  • Wiki
  • 酷站
  • Gems
  • 注册
  • 登录
李华顺
@huacnlee
管理员
第 2 位会员 / 2011-10-28

[email protected]
长桥证券 (Longbridge)
成都
498 篇帖子 / 8938 条回帖
947 关注者
53 正在关注
105 收藏
成都招 Ruby 工程师,有兴趣和我一起工作的邮件联系我
打赏作者
GitHub Public Repos
  • rails-settings-cached 952

    Global settings for your Rails application.

  • rucaptcha 627

    Captcha gem for Rails Application. No dependencies. No ImageMagick, No RMagick.

  • gobackup 621

    🗄 Simple tool for backup your databases, files to FTP / SCP / S3 storages.

  • bluedoc 617

    An open-source document management tool for enterprise self host.

  • carrierwave-aliyun 195

    阿里云 OSS Ruby 上传组件,基于 Carrierwave

  • autocorrect 191

    A linter and formatter for help you improve copywriting, to correct spaces, words, punctuations b...

  • auto-correct 136

    Automatically add whitespace between CJK (Chinese, Japanese, Korean) and half-width characters (a...

  • activestorage-aliyun 115

    Wraps the Aliyun OSS as an Active Storage service.

  • turbolinks-prefetch 66

    Turbolinks extends for prefetch links to speeds up your website.

  • sql-builder 33

    A simple SQL builder for generate SQL for non-ActiveRecord supports databases

More on GitHub
  • 概况
  • 话题
  • 回帖
  • 收藏
  • 正在关注
  • 关注者
  • Ruby 3.0.0 Released at 2020年12月25日

    Ruby 3.0 JIT and beyond

  • Ruby 3.0.0 Released at 2020年12月25日

    Ruby China 已经在跑了

  • Ruby 3.0.0 Released at 2020年12月25日

    实测了一下,有效果

    def tarai(x, y, z)
      x <= y ? y :  tarai(tarai(x - 1, y, z), tarai(y - 1, z, x), tarai(z - 1, x, y))
    end
    
    require "benchmark"
    Benchmark.bm do |x|
      x.report('Ractor') { 6.times.map { Ractor.new { tarai(14, 7, 0) } }.each(&:take) }
    end
    

    我调整参数以后,基于最新的 Ruby 3.0.0 跑,把 MacBook 的 6 核 CPU 全部用上了:


    如果是 Ruby 2.7 用 Thread:

    def tarai(x, y, z)
      x <= y ? y :  tarai(tarai(x - 1, y, z), tarai(y - 1, z, x), tarai(z - 1, x, y))
    end
    
    require "benchmark"
    Benchmark.bm do |x|
      x.report("Thread") { 6.times.map { Thread.new { tarai(14, 7, 0) } }.each(&:join) }
    end
    

  • Ruby 3.0.0 Released at 2020年12月25日

    3.0 的并发支持多核了么?谁知道哪里有参考资料,发来看看

  • Ruby 3.0.0 Released at 2020年12月25日

    Concurrency / Parallel

    It’s multi-core age today. Concurrency is very important. With Ractor, along with Async Fiber, Ruby will be a real concurrent language. — Matz

  • Ruby 的好朋友 -- jemalloc at 2020年12月22日

    Ruby China 的 Docker Image 打包:

    https://ruby-china.org/topics/40730

  • 为 Ruby 3 Fiber 调度器设计事件库 Evt at 2020年12月22日

    拉下来跑了一下 38K,跑完服务器 Crash 了

  • Rails 6.1 升级记录 at 2020年12月17日

    围观 Forem 的升级,貌似挺闹心的,貌似 Gem 和特殊用法太多

    https://github.com/forem/forem/pull/11333


    Homeland 的经验,减少一些奇怪的用法,尽量 Follow Rails way,比如最近我去掉了:

    • request_store - 用 ActiveSupport::CurrentAttributes
    • redis-objects - 用 PostgreSQL 功能或单独实现 Redis 的读写, PR
    • sanitize - 用 Rails HTML Sanitizers PR
    • bulk_insert - 用 ActiveRecord 的 insert_all 方法, Commit

    当然,还有去掉他们一个重要原因是更新太慢,迟迟没跟进社区新版本。


    此外,还去掉了:

    • ElasticSearch - 用 PostgreSQL 的全文搜索
    • hiredis - 其实不需要 Commit
    • database_cleaner - Rails 6 用 Minitest 以后似乎不需要它了,具体谁搞的没仔细看过
    • rack-utf8_sanitizer - 似乎也不需要了
  • Rails 6.1 升级记录 at 2020年12月17日

    另外,我司内部一个比较复杂的后台系统也升级到 Rails 6.1 了,比较顺利

  • Rails 6.1 升级记录 at 2020年12月17日

    https://github.com/ruby-china/homeland/pull/1193

    https://github.com/huacnlee/bluedoc/pull/142

  • Rails 6.1 正式发布了~! at 2020年12月16日

    Homeland 和 BlueDoc 升级 Rails 6.1 的 PR 大家有需要可以参考一下:

    因为这两个项目测试覆盖率较高,所以基本上是直接 rails app:update 根据 Diff 更新默认的几个文件以后,再适当修正一下废弃 API 以及无法升级的 Gem

    https://github.com/ruby-china/homeland/pull/1193

    https://github.com/huacnlee/bluedoc/pull/142

  • Rails 6.1 正式发布了~! at 2020年12月16日

    bulk_insert 可以改用 insert_all 方法代替了,bulk_insert 更新太慢了,我的项目里面都去掉了

    https://api.rubyonrails.org/classes/ActiveRecord/Persistence/ClassMethods.html#method-i-insert_all

    https://github.com/ruby-china/homeland/commit/eb95fc9200889c435ea7bfff5b5accd1a5041427

  • Ruby 3.0.0-preview 版发布了 at 2020年12月14日

    理解问题,Ruby 3 的 3x3 目标是: 性能 3 倍于 Ruby 2.0,而不是 3.0 vs 2.7 或 2.6。

    实际上有数据表明,这个目标已经快达到了(估计目前是 2.5x)

    • https://codefol.io/posts/is-ruby-3-actually-three-times-faster/
    • https://engineering.appfolio.com/appfolio-engineering/2019/3/7/ruby-speed-roundup-20-through-26

    从目前我了解到的其他统计数据来看,3.0 vs 2.6 性能差异不明显

    https://rubybench.org/

  • Rails Mime::Type::InvalidMimeType 的异常在本地是返回 406 错误,但是线上是 500 错误 at 2020年12月12日

    可以试试参考

    config.action_dispatch.rescue_responses

    https://github.com/rails/rails/pull/35753 https://guides.rubyonrails.org/configuring.html#configuring-action-dispatch

  • Rails Mime::Type::InvalidMimeType 的异常在本地是返回 406 错误,但是线上是 500 错误 at 2020年12月12日

    406 是正常的,Rails 的安全保护

  • 新人终于跟着《Ruby on Rails 5 Tutorial 4th》写完了第一个应用,问一些在过程中遇到影响开发体验的问题,请各位大佬指点下。 at 2020年12月11日

    感觉你时间都花在折腾 Vim 配置了

  • ViewComponent 这个框架怎么样? at 2020年12月11日

    GitHub 出的

  • Rails 6.1 正式发布了~! at 2020年12月10日

    升级 6.1 可能最大的难点将是 Autoload mode 的变更,现在 zeitwerk 为默认的。如果你之前的项目的文件组织方式没有 Follow Rails 的约定,将会有困难。

  • Rails 6.1 正式发布了~! at 2020年12月10日

    Ruby China 已完成升级上线

  • ruby-china 的用户信息 API 报"error": "ResourceNotFound" at 2020年12月02日

    https://ruby-china.org/api/v3/users/rei.json

    不能用数字 ID

  • ruby-china 的用户信息 API 报"error": "ResourceNotFound" at 2020年12月01日

    https://ruby-china.org/api/v3/topics/1.json

  • 分享两个有趣的 Ruby 开发者 Andrew Kane 和 Janko Marohnić at 2020年12月01日

    Andrew Kane 好多产出

  • 现在学习 ROR 成本高吗,以前是 Java 选手啊 at 2020年11月18日

    挺简单的,我们这边很多新手一周上手可以开始做项目

  • 升级到 3-7-latest 出现登录不上? at 2020年11月12日

    一直没空解决这个问题

  • 社区有人做过用户安全审计相关的吗 at 2020年10月22日

    https://ruby-china.org/topics/39890

  • 上一页
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • …
  • 315
  • 316
  • 下一页
关于 / RubyConf / Ruby 镜像 / RubyGems 镜像 / 活跃会员 / 组织 / API / 贡献者
由众多爱好者共同维护的 Ruby 中文社区,本站使用 Homeland 构建,并采用 Docker 部署。
服务器由 赞助 CDN 由 赞助
iOS 客户端 / Android 客户端 简体中文 / English