From: Claes W. <kl...@hy...> - 2013-06-04 05:44:49
|
On 6/3/13 10:18 PM, Claes Wikstrom wrote: > On 6/3/13 4:33 PM, Martin Dimitrov wrote: >> Hello, >> >> I am considering to use SSI (http://yaws.hyber.org/ssi.yaws) on the >> entire webpages to do localization of the User Interface. Some pages are >> large (~50KB). Would SSI degrade performance significantly? >> > > > Maybe, the code that does ssi doesn't look like the fastest code in > town. It reads the file, does a binary_to_list on the data, and then > stores chunks so that variable expansion is fast later on. > > Looking at the code it looks as if possible a few list_to_binary/1 calls > would make that code go a lot faster. > I just committed an optimization to that code, SSI pages on 50k should be just fine. The first time the page is fetched, it's parsed and split into chunks looking for the variable expansion things. It's stored in memory (ets) as chunks providing for fast variable expansion. Now that binaries are stored instead of char lists, the data will just be shipped from memory with no copying. /klacke |