4 Star 1 Fork 0

Gitee 极速下载 / openn2o-template

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/openn2o/template.js
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
exp_bench.js 405 Bytes
一键复制 编辑 原始数据 按行查看 历史
agent.zy 提交于 2020-11-19 10:58 . add bench mark
var template = require("./template.js").template;
template.info();
var str = `
{% if (data['k1']==1) do %}
value eq 1 out
{%else%}
value neq 1 out
{%end%}
`
console.log( "tml=" , str );
var a = template.compile(str , 2);
console.time("t")
for(var i = 0; i< 12000000; i++) {
a({"k1":2,"k2":"v2"})
}
console.timeEnd("t")
console.log("===============");
console.log("result:", a({"k1":2,"k2":"v2"}));
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/mirrors/openn2o-template.git
git@gitee.com:mirrors/openn2o-template.git
mirrors
openn2o-template
openn2o-template
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891