編輯:我已經編輯了實際的數字,並用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