编辑:我已经编辑了实际的数字,并用pseudoswears替换了它们,因为我被告知共享性能数据是针对Netsuite的TOS。NetSuite restlet写入性能差
我正在使用restlets将我们的会计系统与NetSuite集成在一起,总的来说,它的表现非常出色。我从性能的角度认识到nlapiLoadRecord是撒旦自己的孩子,所以我尽可能地避免使用搜索api,现在我的阅读restlets非常活泼。然而,每当我要求一个restlet写任何东西,它就像一只乌龟卡在冷焦油中一样慢。我通常会在SLOW和之间分析nlapiSubmitRecord本身的真实时间,其结果为秒。这对我来说似乎很疯狂。没有人会使用NetSuite,如果表现总是这么差写作。我将在下面包含几个代码示例。任何关于加速NetSuite restlet写入性能的提示都将不胜感激。
在这第一个receivedInvoice是传入的数据,并且findCurrencyCode和findCustomerByCustomerNumber是执行这些事情的功能良好的函数。我只是在几乎难以置信的时间点钟,这几乎令人难以置信圣母徒步旅行时间很短秒用于一个简单的发票与一个行项目,几乎所有的时间通过,而我等待nlapiSubmitRecord完成。
var createdInvoice = nlapiCreateRecord('invoice');
createdInvoice.setFieldValue('customform', Number(receivedInvoice.transactionType));
createdInvoice.setFieldValue('memo', receivedInvoice.message);
createdInvoice.setFieldValue('duedate', receivedInvoice.dateDue);
createdInvoice.setFieldValue('currency', findCurrencyCode(receivedInvoice.currencyUnit));
createdInvoice.setFieldValue('location', Number(receivedInvoice.location));
createdInvoice.setFieldValue('postingperiod', findPostingPeriod(receivedInvoice.datePosted));
var customer = findCustomerByCustomerNumber(receivedInvoice.customerNumber);
createdInvoice.setFieldValue('entity', customer.customerId);
createdInvoice.setFieldValue('custbody_end_user', customer.customerId);
createdInvoice.setFieldValue('department', customer.departmentId);
var itemCount = receivedInvoice.items.length;
for(var i = 0; i < itemCount; i++)
{
createdInvoice.selectNewLineItem('item');
createdInvoice.setCurrentLineItemValue('item', 'item',receivedInvoice.items[i].item);
createdInvoice.setCurrentLineItemValue('item', 'quantity', receivedInvoice.items[i].quantity);
createdInvoice.setCurrentLineItemValue('item', 'rate',receivedInvoice.items[i].price);
createdInvoice.setCurrentLineItemValue('item', 'custcol_list_rate',receivedInvoice.items[i].price);
createdInvoice.setCurrentLineItemValue('item', 'amount',receivedInvoice.items[i].totalAmount);
createdInvoice.setCurrentLineItemValue('item', 'description',receivedInvoice.items[i].description);
createdInvoice.commitLineItem('item');
}
var recordNumber = nlapiSubmitRecord(createdInvoice,false,true);
在这其中我觉得我在动态模式下打开记录犯了性能异端,但我不知道怎么回事,得到的可能行项目。只需在动态模式下开启新纪录约SLOW秒。再次,提交是大多数时间被吃掉的地方(通常在之间OH亲爱的甜心可爱秒),虽然这个人吃了很多时间,因为我弄乱了订单项,再次推测可能是因为我打开了记录在动态模式下。
var customerPayment = nlapiCreateRecord('customerpayment',{recordmode: 'dynamic'});
customerPayment.setFieldValue('customer', parseInt(customerId));
customerPayment.setFieldValue('payment', paymentAmount);
customerPayment.setFieldValue('paymentmethod', paymentMethod);
customerPayment.setFieldValue('checknum', transactionId);
customerPayment.setFieldValue('currency', currency);
customerPayment.setFieldValue('account', account);
var applyCount = customerPayment.getLineItemCount('apply');
if(applyCount>0)
{
for(var i=1;i<=applyCount;i++)
{
var thisInvoice = customerPayment.getLineItemValue('apply','refnum',i);
if(thisInvoice == invoiceToPay)
{
customerPayment.selectLineItem('apply', i);
customerPayment.setCurrentLineItemValue('apply','apply','T');
customerPayment.setCurrentLineItemValue('apply', 'amount',paymentAmount);
customerPayment.commitLineItem('apply');
}
}
}
nlapiSubmitRecord(customerPayment,false,true);
谢谢你的pseudoswears - 他们让我笑。另外:分享表现违反了他们的TOS ...? NetSuite是否默认他们的表现是悲惨的? – Krypton
看来公司不幸的是不幸的是:https://stackoverflow.com/questions/12115397/is-it-against-license-to-publish-oracle-and-sql-server-performance-test – gabrielf
Powercow,你是否曾经能够解决你的性能问题?你在Netsuite的沙箱或生产环境中执行过测试吗?生产环境中的性能是否更好? – gabrielf