首页 文章 精选 留言 我的

精选列表

搜索[函数],共10000篇文章
优秀的个人博客,低调大师

使用Chrome开发者工具研究JavaScript里函数的原生实现

As the size of my blog Chrome Development Tool tips used in my daily work turns to be larger I create a separate post to record down this small tip.Are you curious about the “native code” here? At least I am. Today I find that the Profiles tab in Chrome development tool can help us to unveil the mysteries to some degree.In Chrome development, just select this checkbox: And then execute the simple JavaScript code below: var arr = []; for (var i=0; i<1000; i++){ arr.push(i) } console.profile("Array toString"); for( var i = 0; i < 1000; i++){ var a = arr.toString(); } console.profileEnd("Array toString"); Once done, you can see a profile record with the name specified in JavaScript code above, “Array toString”. Hover the mouse to the first row, “anonymous function”, we find the hint “array.js”. Switch display style from Chart to Tree: From here the callstack of native implementation of toString is displayed: The next step is to look into in array.js.Launch url: https://cs.chromium.org/Click this hyperlink: now you can find the array.js file via path: src/v8/src/js/array.js The callstack analyzed through the source code exactly matches the one we get in Chrome development tool Profile tab:ArrayToString will delegate to Join if current caller is an Array: Join will call DoJoin: DoJoin will first call UseSparseVariant to evaluate the possibility to perform Join via SparseVariant. If not possible, call ConvertToString as fall back. ( The line number of source code may vary with the one you see in Chrome Development Tool profile tab due to the different version of Chrome being used. ) If you could not tolerate the poor performance of this online source code repository, you could download the whole source code of V8 to your local laptop by cloning this github repository:https://chromium.googlesource.com/v8/v8.git/ 本文来自云栖社区合作伙伴“汪子熙”,了解相关信息可以关注微信公众号"汪子熙"。

优秀的个人博客,低调大师

msg.js 更新,增加提示消失时的回调函数

更新项: 增加提示消息、操作成功、操作失败提示窗消失时的回调,msg.info() 、 msg.success()、 msg.failure() 这三个都支持这种方式。使用如: msg.info('Hello Msg', function(){ alert(123); }); msg.js ,纯原生 JavaScript 无任何三方框架! 快速使用 第一步,引入 msg.js <script src="https://res.weiunity.com/msg/msg.js"></script> 第二步,一行代码使用 msg.info('Hello Msg')

优秀的个人博客,低调大师

函数计算 python runtime 常用的第三方包下载

问题 尽管 python runtime 使用第三方包 文档中比较详细地介绍了如果使用第三方包,但是还是有不少用户遇见了问题,尤其是windows 用户在此block了不少时间,本文根据最近用户反馈的情况,提供可以直接在线上环境运行的最精简库代码包下载 代码包下载链接 lib python2.7 python3.6 pandas_0.23.4 pandas_0.23.4.zip pandas_0.23.4.zip pillow_5.3.0 pillow_5.3.0.zip pillow_5.3.0.zip pymysql_0.9.3 pymysql_0.9.3.zip pymyssql_0.9.3.zip pymongo_3.7.2 pymongo_3.7.2.zip pymongo_3.7.2.zip blaze_0.10.1 blaze_0.10.1.zip bla

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册
修改密码
忘记密码