data: A3 提效对比实验数据(23 样例 + 人工基线 + 插件实测,整体提速约 266 倍)
- data/efficiency-samples/ 23 个多语言样例 + data/manual-review-tool.html 人工审核工具 - tests/measure/measure-plugin-samples.mjs 四语言插件侧测量脚本 - tests/measure/compare-a3.mjs 聚合对比 + results(插件实测/人工基线/comparison) - performance-comparison.md 填实基线对比与结论;README 效果总结由占位改为真实数据
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
// sample-1: order service module
|
||||
var config = { retries: 3 };
|
||||
|
||||
function orderProcess(items) {
|
||||
var total = 0;
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
total += items[i].amount;
|
||||
}
|
||||
if (total == 0) {
|
||||
return null;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
function orderValidate(record) {
|
||||
var shadowed = record.id;
|
||||
function inner() {
|
||||
var shadowed = record.alt;
|
||||
return shadowed;
|
||||
}
|
||||
if (record.value === record.value) {
|
||||
inner();
|
||||
}
|
||||
return shadowed;
|
||||
}
|
||||
|
||||
function orderUnsafe(input) {
|
||||
var unused = computeLegacy(input);
|
||||
eval(input.expression);
|
||||
debugger;
|
||||
}
|
||||
|
||||
function computeLegacy(x) {
|
||||
if (x.pending) {}
|
||||
x.count = x.count;
|
||||
return x;
|
||||
}
|
||||
|
||||
module.exports = { orderProcess, orderValidate, orderUnsafe, config };
|
||||
@@ -0,0 +1,39 @@
|
||||
// sample-2: inventory service module
|
||||
var config = { retries: 3 };
|
||||
|
||||
function inventoryProcess(items) {
|
||||
var total = 0;
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
total += items[i].amount;
|
||||
}
|
||||
if (total == 0) {
|
||||
return null;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
function inventoryValidate(record) {
|
||||
var shadowed = record.id;
|
||||
function inner() {
|
||||
var shadowed = record.alt;
|
||||
return shadowed;
|
||||
}
|
||||
if (record.value === record.value) {
|
||||
inner();
|
||||
}
|
||||
return shadowed;
|
||||
}
|
||||
|
||||
function inventoryUnsafe(input) {
|
||||
var unused = computeLegacy(input);
|
||||
eval(input.expression);
|
||||
debugger;
|
||||
}
|
||||
|
||||
function computeLegacy(x) {
|
||||
if (x.pending) {}
|
||||
x.count = x.count;
|
||||
return x;
|
||||
}
|
||||
|
||||
module.exports = { inventoryProcess, inventoryValidate, inventoryUnsafe, config };
|
||||
@@ -0,0 +1,39 @@
|
||||
// sample-3: billing service module
|
||||
var config = { retries: 3 };
|
||||
|
||||
function billingProcess(items) {
|
||||
var total = 0;
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
total += items[i].amount;
|
||||
}
|
||||
if (total == 0) {
|
||||
return null;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
function billingValidate(record) {
|
||||
var shadowed = record.id;
|
||||
function inner() {
|
||||
var shadowed = record.alt;
|
||||
return shadowed;
|
||||
}
|
||||
if (record.value === record.value) {
|
||||
inner();
|
||||
}
|
||||
return shadowed;
|
||||
}
|
||||
|
||||
function billingUnsafe(input) {
|
||||
var unused = computeLegacy(input);
|
||||
eval(input.expression);
|
||||
debugger;
|
||||
}
|
||||
|
||||
function computeLegacy(x) {
|
||||
if (x.pending) {}
|
||||
x.count = x.count;
|
||||
return x;
|
||||
}
|
||||
|
||||
module.exports = { billingProcess, billingValidate, billingUnsafe, config };
|
||||
@@ -0,0 +1,39 @@
|
||||
// sample-4: customer service module
|
||||
var config = { retries: 3 };
|
||||
|
||||
function customerProcess(items) {
|
||||
var total = 0;
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
total += items[i].amount;
|
||||
}
|
||||
if (total == 0) {
|
||||
return null;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
function customerValidate(record) {
|
||||
var shadowed = record.id;
|
||||
function inner() {
|
||||
var shadowed = record.alt;
|
||||
return shadowed;
|
||||
}
|
||||
if (record.value === record.value) {
|
||||
inner();
|
||||
}
|
||||
return shadowed;
|
||||
}
|
||||
|
||||
function customerUnsafe(input) {
|
||||
var unused = computeLegacy(input);
|
||||
eval(input.expression);
|
||||
debugger;
|
||||
}
|
||||
|
||||
function computeLegacy(x) {
|
||||
if (x.pending) {}
|
||||
x.count = x.count;
|
||||
return x;
|
||||
}
|
||||
|
||||
module.exports = { customerProcess, customerValidate, customerUnsafe, config };
|
||||
@@ -0,0 +1,39 @@
|
||||
// sample-5: shipping service module
|
||||
var config = { retries: 3 };
|
||||
|
||||
function shippingProcess(items) {
|
||||
var total = 0;
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
total += items[i].amount;
|
||||
}
|
||||
if (total == 0) {
|
||||
return null;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
function shippingValidate(record) {
|
||||
var shadowed = record.id;
|
||||
function inner() {
|
||||
var shadowed = record.alt;
|
||||
return shadowed;
|
||||
}
|
||||
if (record.value === record.value) {
|
||||
inner();
|
||||
}
|
||||
return shadowed;
|
||||
}
|
||||
|
||||
function shippingUnsafe(input) {
|
||||
var unused = computeLegacy(input);
|
||||
eval(input.expression);
|
||||
debugger;
|
||||
}
|
||||
|
||||
function computeLegacy(x) {
|
||||
if (x.pending) {}
|
||||
x.count = x.count;
|
||||
return x;
|
||||
}
|
||||
|
||||
module.exports = { shippingProcess, shippingValidate, shippingUnsafe, config };
|
||||
@@ -0,0 +1,39 @@
|
||||
// sample-6: coupon service module
|
||||
var config = { retries: 3 };
|
||||
|
||||
function couponProcess(items) {
|
||||
var total = 0;
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
total += items[i].amount;
|
||||
}
|
||||
if (total == 0) {
|
||||
return null;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
function couponValidate(record) {
|
||||
var shadowed = record.id;
|
||||
function inner() {
|
||||
var shadowed = record.alt;
|
||||
return shadowed;
|
||||
}
|
||||
if (record.value === record.value) {
|
||||
inner();
|
||||
}
|
||||
return shadowed;
|
||||
}
|
||||
|
||||
function couponUnsafe(input) {
|
||||
var unused = computeLegacy(input);
|
||||
eval(input.expression);
|
||||
debugger;
|
||||
}
|
||||
|
||||
function computeLegacy(x) {
|
||||
if (x.pending) {}
|
||||
x.count = x.count;
|
||||
return x;
|
||||
}
|
||||
|
||||
module.exports = { couponProcess, couponValidate, couponUnsafe, config };
|
||||
@@ -0,0 +1,39 @@
|
||||
// sample-7: refund service module
|
||||
var config = { retries: 3 };
|
||||
|
||||
function refundProcess(items) {
|
||||
var total = 0;
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
total += items[i].amount;
|
||||
}
|
||||
if (total == 0) {
|
||||
return null;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
function refundValidate(record) {
|
||||
var shadowed = record.id;
|
||||
function inner() {
|
||||
var shadowed = record.alt;
|
||||
return shadowed;
|
||||
}
|
||||
if (record.value === record.value) {
|
||||
inner();
|
||||
}
|
||||
return shadowed;
|
||||
}
|
||||
|
||||
function refundUnsafe(input) {
|
||||
var unused = computeLegacy(input);
|
||||
eval(input.expression);
|
||||
debugger;
|
||||
}
|
||||
|
||||
function computeLegacy(x) {
|
||||
if (x.pending) {}
|
||||
x.count = x.count;
|
||||
return x;
|
||||
}
|
||||
|
||||
module.exports = { refundProcess, refundValidate, refundUnsafe, config };
|
||||
@@ -0,0 +1,39 @@
|
||||
// sample-8: invoice service module
|
||||
var config = { retries: 3 };
|
||||
|
||||
function invoiceProcess(items) {
|
||||
var total = 0;
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
total += items[i].amount;
|
||||
}
|
||||
if (total == 0) {
|
||||
return null;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
function invoiceValidate(record) {
|
||||
var shadowed = record.id;
|
||||
function inner() {
|
||||
var shadowed = record.alt;
|
||||
return shadowed;
|
||||
}
|
||||
if (record.value === record.value) {
|
||||
inner();
|
||||
}
|
||||
return shadowed;
|
||||
}
|
||||
|
||||
function invoiceUnsafe(input) {
|
||||
var unused = computeLegacy(input);
|
||||
eval(input.expression);
|
||||
debugger;
|
||||
}
|
||||
|
||||
function computeLegacy(x) {
|
||||
if (x.pending) {}
|
||||
x.count = x.count;
|
||||
return x;
|
||||
}
|
||||
|
||||
module.exports = { invoiceProcess, invoiceValidate, invoiceUnsafe, config };
|
||||
Reference in New Issue
Block a user