实验性质的JIT compiler(Ruby2.6)
Ruby2.6的一个新的功能:Just in time complier
特点:
和传统的JIT编译器不一样之处:把代码写成C并存储在磁盘,并使用一个C编译器来生成native code。这样就节省了运行时间。改善了Ruby程序的执行效率。
传统的编译器如bootsnap会在第一次运行一个Ruby Script时,把YARV instruciton存到disk。之后还运行这个脚本就省略了parse和complie的过程,直接使用YARV instruction。这会提升大概30%的运行速度。
使用MJIT编译YARN instruction
(M是开发者的名字)它会对已存在的YARV instruction进行操作,以提升运行速度。
当YARV instruction 存在后,RubyVM会在运行时把那些instruction转化成native code(用于操作系统和cpu)。
一个Ruby程序运行的70%的时间都是这个process花费的。这是一笔很大的时间占用。
所以JIT编译器出现了。它的作用是把YARV instruction转化成的C语言代码存在disk上。当一个YARV instruction再次出现,直接使用对应的C代码和C编译器来生成native code。这样就节省了时间。
注意:⚠️
实验性质的功能。Rails不会从中受益。
many other memory-intensive workloads like Rails applications might not benefit from it at the moment.
使用:
$ruby -v
//是2.6.0以上版本
$ruby --git test.rb
//使用--git-verbose=1 在terminal上打印出additional information。
//或者用环境变量
$RUBYOPT="--jit" rails s
实验性质的JIT compiler(Ruby2.6)的更多相关文章
- Off-heap Memory in Apache Flink and the curious JIT compiler
https://flink.apache.org/news/2015/09/16/off-heap-memory.html Running data-intensive code in the J ...
- How AOT compares to a traditional JIT compiler
Ahead-of-Time (AOT) compilation is in contrast to Just-in-Time compilation (JIT). In a nutshell, .NE ...
- Understanding How Graal Works - a Java JIT Compiler Written in Java
https://chrisseaton.com/truffleruby/jokerconf17/ https://chrisseaton.com/truffleruby/tenthings/ http ...
- 利用hsdis和JITWatch查看分析HotSpot JIT compiler生成的汇编代码
http://blog.csdn.net/hengyunabc/article/details/26898657
- 「译」Graal JIT编译器是如何工作的
原文Understanding How Graal Works - a Java JIT Compiler Written in Java,讲了jvmci和ideal graph的基本概念以及一些优化 ...
- JIT编译器
深入理解Java Class文件格式(九) http://blog.csdn.net/zhangjg_blog/article/details/22432599 http://blog.csdn.ne ...
- 球谐光照(Spherical Harmonics Lighting)及其应用-实验篇
简介 之前在一篇实时深度图优化的论文中看到球谐光照(Spherical Harmonics Lighting)的应用,在查阅了许许多多资料之后还是无法完全理解,我个人觉得如果之前对实时渲染技术不是很了 ...
- JVM ,JIT ,GC RUNTIME 解析
Java Class字节码知识点回顾 https://yq.aliyun.com/articles/2358?spm=5176.8067842.tagmain.105.fQdvH3 JVM Class ...
- Pre-compile (pre-JIT) your assembly on the fly, or trigger JIT compilation ahead-of-time (转)
Introduction All .NET developers know that one of the best features of the CLR is JIT-compilation: J ...
随机推荐
- mysql----------mysql的一些常用命令
1.查询一张表中某个字段重复值的记录 select id,cert_number from (select id,cert_number,count(*)as n from 表明 group by c ...
- git----------如何安装gitlab,使用步骤。
1.配置yum源 vim /etc/yum.repos.d/gitlab-ce.repo 2.复制以下内容到打开的文件中: [gitlab-ce] name=Gitlab CE ...
- eclipse 编码改成utf-8
Eclipse的编码格式是系统默认 修改为utf-8,点击Apply and Close 然后项目的编码格式会统一默认utf-8 当然也可以选择other,改成GBK.
- Linux安全之SSH 密钥创建及密钥登录
1.首先进入Linux系统的用户目录下的.ssh目录下,root用户是/root/.ssh,普通用户是/home/您的用户名/.ssh,我们以root用户为例: cd .ssh #如果没有 自己创建 ...
- linux 邮件服务器—Extmail
环境: Centos 6.5 :172.16.9.13 (DNS 服务器) Centos 6.5: 172.16.9.11 (postfix 邮件服务器) 安装软件: yum -y install p ...
- golang 基本数据结构使用
1 goalng struct 1.1 var s1 student 1.2 s2 := student {"zhou", 33} 1.3 s3 := student {Name: ...
- html5与css3面试题(2)
10.xhtml与HTML的区别? Html是对web网页设计的语言,而xhtml是基于xml的置标语言 11.面向对象的引用方法分为几种? 内部写的 原型链引用的 12.什么是重载? 函数名相同,但 ...
- vscode中添加git
步骤: 下载Git客户端 配置环境变量 设置vscode与Git的关联 重启 步骤一: 该网址,下载即可. https://git-scm.com/downloads 步骤二: 计算机 > 属性 ...
- js 获取链接参数的方法
方法1: /** * 获取链接上的参数 * string 需要获取的参数名称 */ var getHref = function(string){ var reg = new RegExp(" ...
- ORA-19606: Cannot copy or restore to snapshot control file
delete obsolete; 发现出现报错 ORA-19606: Cannot copy or restore to snapshot control file 解决办法:CONFIGURE SN ...