mirror of
https://github.com/multipleof4/lynchmark.git
synced 2026-01-14 00:27:55 +00:00
Docs: Update benchmark results
This commit is contained in:
@@ -2,4 +2,6 @@ async function renderTemplate(template, data) {
|
||||
const { default: Handlebars } = await import('https://esm.sh/handlebars');
|
||||
return Handlebars.compile(template)(data);
|
||||
}
|
||||
export default renderTemplate;
|
||||
export default renderTemplate;
|
||||
// Generation time: 2.930s
|
||||
// Result: PASS
|
||||
@@ -1,9 +1,7 @@
|
||||
async function renderTemplate(templateString, data) {
|
||||
const { default: Handlebars } = await import(
|
||||
'https://cdn.jsdelivr.net/npm/handlebars@4.7.8/dist/handlebars.min.js'
|
||||
);
|
||||
|
||||
const template = Handlebars.compile(templateString);
|
||||
return template(data);
|
||||
async function renderTemplate(template, data) {
|
||||
const { default: Handlebars } = await import('https://cdn.jsdelivr.net/npm/handlebars@4.7.8/dist/handlebars.min.js');
|
||||
return Handlebars.compile(template)(data);
|
||||
}
|
||||
export default renderTemplate;
|
||||
export default renderTemplate;
|
||||
// Generation time: 2.224s
|
||||
// Result: FAIL
|
||||
@@ -1,5 +0,0 @@
|
||||
const renderTemplate = async (templateString, data) => {
|
||||
const { default: Handlebars } = await import('https://cdn.jsdelivr.net/npm/handlebars@latest/dist/handlebars.min.js');
|
||||
return Handlebars.compile(templateString)(data);
|
||||
};
|
||||
export default renderTemplate;
|
||||
@@ -1,5 +1,6 @@
|
||||
const renderTemplate = async (tmpl, data) => {
|
||||
const { default: H } = await import('https://cdn.jsdelivr.net/npm/handlebars@latest/+esm')
|
||||
return H.compile(tmpl)(data)
|
||||
}
|
||||
export default renderTemplate;
|
||||
const renderTemplate = async (t, d) =>
|
||||
(await import('https://esm.sh/handlebars'))
|
||||
.default.compile(t)(d)
|
||||
export default renderTemplate;
|
||||
// Generation time: 29.656s
|
||||
// Result: PASS
|
||||
@@ -1,7 +1,12 @@
|
||||
let h, c = new Map();
|
||||
const renderTemplate = async (t, d) => {
|
||||
h ||= (await import('https://cdn.jsdelivr.net/npm/handlebars@4.7.8/dist/handlebars.min.js')).default;
|
||||
c.has(t) || c.set(t, h.compile(t));
|
||||
return c.get(t)(d);
|
||||
let hb;
|
||||
export const renderTemplate=async(t,d)=>{
|
||||
try{
|
||||
hb??=(await import('https://cdn.jsdelivr.net/npm/handlebars@4.7.8/dist/handlebars.mjs')).default;
|
||||
return hb.compile(t)(d);
|
||||
}catch(e){
|
||||
throw new Error(`Render failed: ${e.message}`);
|
||||
}
|
||||
};
|
||||
export default renderTemplate;
|
||||
export default renderTemplate;
|
||||
// Generation time: 50.722s
|
||||
// Result: FAIL
|
||||
@@ -1,5 +1,7 @@
|
||||
async function renderTemplate(t,d){
|
||||
const {default:h}=await import('https://cdn.jsdelivr.net/npm/handlebars@latest/+esm')
|
||||
return h.compile(t)(d)
|
||||
async function renderTemplate(tpl, data) {
|
||||
const { default: h } = await import('https://cdn.jsdelivr.net/npm/handlebars@latest/dist/handlebars.esm.js')
|
||||
return h.compile(tpl)(data)
|
||||
}
|
||||
export default renderTemplate;
|
||||
export default renderTemplate;
|
||||
// Generation time: 2.868s
|
||||
// Result: FAIL
|
||||
@@ -1,6 +0,0 @@
|
||||
const renderTemplate = async (template, data) => {
|
||||
const { default: Handlebars } = await import('https://cdn.jsdelivr.net/npm/handlebars@latest/dist/handlebars.min.js')
|
||||
const compiled = Handlebars.compile(template)
|
||||
return compiled(data)
|
||||
}
|
||||
export default renderTemplate;
|
||||
@@ -1,8 +0,0 @@
|
||||
const getHandlebars=(async()=>(await import('https://esm.sh/handlebars@4.7.8')).default)();
|
||||
|
||||
async function renderTemplate(template,data){
|
||||
const Handlebars=await getHandlebars;
|
||||
const fn=Handlebars.compile(template);
|
||||
return fn(data);
|
||||
}
|
||||
export default renderTemplate;
|
||||
8
tests/4_transpiler/outputs/x-ai_grok-4.js
Normal file
8
tests/4_transpiler/outputs/x-ai_grok-4.js
Normal file
@@ -0,0 +1,8 @@
|
||||
async function renderTemplate(template, data) {
|
||||
const { default: Handlebars } = await import('https://esm.sh/handlebars');
|
||||
const compiled = Handlebars.compile(template);
|
||||
return compiled(data);
|
||||
}
|
||||
export default renderTemplate;
|
||||
// Generation time: 22.419s
|
||||
// Result: PASS
|
||||
Reference in New Issue
Block a user