实验性质的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 ...
随机推荐
- C# Window Service安装、卸载、恢复选项操作
using System;using System.Diagnostics;using System.Linq;using System.ServiceProcess; namespace ScmWr ...
- Roomblock: a Platform for Learning ROS Navigation With Roomba, Raspberry Pi and RPLIDAR(转)
What is this? "Roomblock" is a robot platform consists of a Roomba, a Raspberry Pi 2, a ...
- 零门槛,包教会。让你在5分钟内使用以太坊ERC20智能合约发行属于自己的空气币
前言 目前区块链是互联网中最最火的风口,没有之一.我周围的很多朋友也加入了“炒币”行列,但很不幸,几乎都被“割韭菜”了.而经过我的几天研究,发现,如果自己要发行一种空气币,简直太简单了.只需要下面几个 ...
- 移动App专项测试
移动App测试实战—专项测试 转自:http://www.51testing.com/html/58/n-3713758.html 我们在进行了手工的功能测试之后,也开发了一些自动化测试用例,并且做了 ...
- html5与css3面试题(2)
10.xhtml与HTML的区别? Html是对web网页设计的语言,而xhtml是基于xml的置标语言 11.面向对象的引用方法分为几种? 内部写的 原型链引用的 12.什么是重载? 函数名相同,但 ...
- flask 电子邮件Flask-Mail
电子邮件 在web程序中,经常会需要发送电子邮件.比如,在用户注册账户时发送确认邮件:定期向用户发送热门内容或是促销信息等等.在Web程序中发送电子邮件并不复杂,借助扩展Flask-Mail或是第三方 ...
- MongoDB 3.4 安装以 Windows 服务方式运行
1.首先从https://www.mongodb.com/download-center#community 下载社区版,企业版也是类似. 2.双击运行安装,可自定义安装路径,这里采用默认路径(C:\ ...
- leetcode 二进制求和 python
class Solution: def addBinary(self, a, b): """ :type a: str :type b: str :rtype: str ...
- CEF 支持的命令行参数
参考:https://peter.sh/experiments/chromium-command-line-switches/ List of Chromium Command Line Switch ...
- Docker 简单部署 ElasticSearch
https://www.cnblogs.com/jianxuanbing/p/9410800.html