From 244a90cdca993d39ac02f053a19fd950c1a93ced Mon Sep 17 00:00:00 2001 From: valadaptive <79560998+valadaptive@users.noreply.github.com> Date: Sun, 15 Sep 2024 19:28:26 -0400 Subject: [PATCH] Fix perf script (#474) --- etc/scripts/perf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etc/scripts/perf b/etc/scripts/perf index a8c8e2fe..ab0fb3f4 100755 --- a/etc/scripts/perf +++ b/etc/scripts/perf @@ -17,7 +17,8 @@ let avro = require('../../lib'), Benchmark = require('benchmark'), - path = require('path'); + path = require('path'), + fs = require('fs'); let paths = process.argv.slice(2); @@ -38,7 +39,8 @@ console.log(['fromBuffer', 'toBuffer', 'isValid ', '(ops/sec)'].join('\t| ')); console.log(['---------:', '-------:', '------: ', '---------'].join('\t| ')); paths.forEach((fpath) => { - let type = avro.parse(fpath, {wrapUnions: wrap}); + let schema = JSON.parse(fs.readFileSync(fpath, 'utf-8')); + let type = avro.Type.forSchema(schema, {wrapUnions: wrap}); let values = []; let bufs = [];