I'm wondering if publishing of a document would speed up when you would set less properties before publishing.
My code at this time is
dProduct.Text = product.PLU.ToString(); // Je moet ook de naam wijzigen als de omschrijving wordt gewijzigd dProduct.getProperty("pLU").Value = product.PLU; dProduct.getProperty("barcode").Value = product.barcode; dProduct.getProperty("price").Value = product.price; dProduct.getProperty("percentage").Value = product.percentage; dProduct.getProperty("weight").Value = product.weight; dProduct.getProperty("size").Value = product.size; dProduct.getProperty("stock").Value = product.stock; dProduct.Publish(umbraco.BusinessLogic.User.GetUser(0)); umbraco.library.UpdateDocumentCache(dProduct.Id);
But only the stock-amount changes regularly. Would it be faster to check whether the other properties are changed and only set the stock-property if nothing else has changed.
Your system will have a very accurate answer... did you ask it and what did it say? (i.e. did you try running both compositions of the equivalent method over n interations and what were the profiling results?)
What do you mean? It would be exactly accurate as all the times will be relative to the system. It's not about getting accurate times of how long X will take in a "real" environment, it's the comparison of the time it takes X over Y where the results will be relative and transferable: say X takes 30secs on staging, Y takes 1min consistently, then it follows, all else being equal, that even with better hardware X will take less time on production than Y.
Speeding up document publishing
Hi,
I'm wondering if publishing of a document would speed up when you would set less properties before publishing.
My code at this time is
But only the stock-amount changes regularly. Would it be faster to check whether the other properties are changed and only set the stock-property if nothing else has changed.
Hope somebody has an answer, thanks in advance.
Jeffrey
Your system will have a very accurate answer... did you ask it and what did it say? (i.e. did you try running both compositions of the equivalent method over n interations and what were the profiling results?)
Hi Grant,
good point :) But I'm on a testing-environment with a lot of other developers, and the timing wouldn't be very accurate.
Greetings,
Jeffrey
What do you mean? It would be exactly accurate as all the times will be relative to the system. It's not about getting accurate times of how long X will take in a "real" environment, it's the comparison of the time it takes X over Y where the results will be relative and transferable: say X takes 30secs on staging, Y takes 1min consistently, then it follows, all else being equal, that even with better hardware X will take less time on production than Y.
Each time you set a value, it is written to the database.
When you publish, all values are fetched from the database to create an XML representation of the content.
So yes, in theory, just setting the properties that haven't change should be faster.
is working on a reply...