OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Extremely Slow Saving sxw document
Goto page 1, 2  Next
 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
sju59
General User
General User


Joined: 09 Mar 2004
Posts: 9

PostPosted: Tue Mar 09, 2004 10:41 am    Post subject: Extremely Slow Saving sxw document Reply with quote

I am working with a document which is around 40 pages with 5 or 6 half page graphics. There is nothing else special about the document. Saving in OpenOffice format is extremely slow, sometimes as long as 2 or 3 minutes, while saving the exact same document as .DOC is instant. Any ideas why this happens? I would rather use .sxw so I do not lose any formatting. Please help!

Laughing
Back to top
View user's profile Send private message
dfrench
Moderator
Moderator


Joined: 03 Mar 2003
Posts: 1605
Location: Wellington, New Zealand

PostPosted: Tue Mar 09, 2004 11:33 am    Post subject: Reply with quote

My guess is that OOo is making a bit of a meal of the graphics. How big is the document when stored as a .sxw? How much memory is occupied by it when it is loaded? What are the graphics type, size and dimensions.??
Back to top
View user's profile Send private message
sju59
General User
General User


Joined: 09 Mar 2004
Posts: 9

PostPosted: Tue Mar 09, 2004 12:43 pm    Post subject: Reply with quote

The document is about 730K when saved as sxw and around 732K when saved as .doc, from my experience this is kinda wierd, normally sxw is WAY smaller. There are 7 charts which were copied directly from Excel. They are around 6 inches by 4 inches each. The program takes up about 142MB of memory when the doc is loaded and about 140MB when the doc is not loaded. Thanks for any help. You would think that OO would be able to save things faster in its native format...
Back to top
View user's profile Send private message
Fusion
General User
General User


Joined: 28 Feb 2004
Posts: 39

PostPosted: Tue Mar 09, 2004 1:25 pm    Post subject: Reply with quote

The reason sxw is usually much smaller is that it is compressed. Rename a .sxw file with a .zip extension sometime and examine it with WinZip or whatever you normally use to open Zip files. This is also probably the reason that it's taking so long to save - compression can be time-consuming.

The fact that it isn't compressing very much probably indicates that 1) image data makes up most of the size and 2) the image data is not compressing very well. This is not very surprising. Image data often doesn't compress well with general-purpose compression algorithms like those used for by the Zip format. Compression algorithms designed specifically for image data do much better. It's also possible that your images are already compressed, and therefore they can't be compressed much more. Finally, it's also possible that the images are already compressed, but poorly. Poorly compressed data can theoretically be compressed more, but this doesn't usually work very well if you try to apply the better compression to the already-compressed data. It's better to decompress first, then apply the improved compression. So for example, I can use bzip2 (one of the best general-purpose compression programs available) on my zip archives, but it would be a lot smarter to first extract the data from the zip archive, then compress it with bzip2.

Now, one thing I think you could do to speed things up and reduce your file size is to rip out your images, compress them (better), then add them back into your document. If the are already well-compressed, this won't help at all. But I think the more you reduce the image file sizes, the quicker your saves will be, simply because there's less data for the compression routines to go through.

To compress your images well you'll need to choose the right format. There are basically two good choices - JPEG and PNG. Use JPEG for high-color images like photographs. Use PNG for low-color images like icons, but make sure you choose the 8-bit palette-based version. GIF is another option for this type of image, but PNG is better in nearly every respect. Both PNG and JPEG have grayscale modes, also. For some images you might just have to try both and see whcih works better. Finally, for any image that you want to compress without loss (which is usually not important), use PNG in the 24-bit RGB mode (unless it's greyscale, then use the PNG greyscale mode).

In most cases, the amount of compression and the quality of the result depend on the software that does the compression. JPEG will look particularly bad when compressed using shoddy software. PNG-8 will be ugly if the original image had more the 256 colors, and the software does poor color reduction.


Last edited by Fusion on Tue Mar 09, 2004 1:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
Fusion
General User
General User


Joined: 28 Feb 2004
Posts: 39

PostPosted: Tue Mar 09, 2004 1:35 pm    Post subject: Reply with quote

Here's another idea.

I think OOo lets you insert images as "links", so that the image is not stored with the file, but instead the file refers to the image on your disk. This would be bad for distributing a document, because you'd need to send all the images along with it, and they'd have to end up in the right place in order for OOo to find them when the document is opened. But it might be good for working on the document. The images will not be saved along with the file, so they won't be passed through the compression routines. When you finish with the document, you can embed the images with the document again, so that you have a single file that can be distributed.

If you want to try this, make sure that there's an easy way to switch from the "Links" to embeding the images. I've never tried this, and if it's complicated then this might not be a very good option.
Back to top
View user's profile Send private message
sju59
General User
General User


Joined: 09 Mar 2004
Posts: 9

PostPosted: Tue Mar 09, 2004 2:36 pm    Post subject: Reply with quote

Thanks for the replies. I guess I should say that I honestly care less about how slow it saves than I do about thte fact that the OO format saves slower than the .Doc does, and MUCH slower at that. I really strongly believe in the open source software movement and I want to make sure this is not a problem which something needs to be done about. If I was working in a company I might say that this is unacceptable performance and scrap using OO. Is there any way to disable compression of pictures? Maybe that would solve my problem.
Back to top
View user's profile Send private message
Kaaredyret
Moderator
Moderator


Joined: 22 Aug 2003
Posts: 1356
Location: Denmark

PostPosted: Tue Mar 09, 2004 3:27 pm    Post subject: Reply with quote

Saving of huge files in OOo is too slow, whatever the excuse. And remember that this slow speed goes for commercial StarOffice too...

Perhaps Word docs and Excel spreadsheets are bigger, and so what. Waiting minutes for Calc to save a large spreadsheet is not worth the saved bytes.
_________________
www.kaaredyret.dk - OpenOffice resources (templates, extensions, tutorials and more) !
Stay updated on software and OpenOffice.org news via Twitter
Back to top
View user's profile Send private message Visit poster's website
sju59
General User
General User


Joined: 09 Mar 2004
Posts: 9

PostPosted: Tue Mar 09, 2004 3:31 pm    Post subject: Reply with quote

I would have to agree with you. I really don't have a problem saving it as a .doc but little things seemed to be messed up everytime I save it that way and then open it back up, but its fine in sxw.
Back to top
View user's profile Send private message
Kaaredyret
Moderator
Moderator


Joined: 22 Aug 2003
Posts: 1356
Location: Denmark

PostPosted: Tue Mar 09, 2004 4:25 pm    Post subject: Reply with quote

Yep, unfortunately saving as .doc is not the solution either. Sad
_________________
www.kaaredyret.dk - OpenOffice resources (templates, extensions, tutorials and more) !
Stay updated on software and OpenOffice.org news via Twitter
Back to top
View user's profile Send private message Visit poster's website
dfrench
Moderator
Moderator


Joined: 03 Mar 2003
Posts: 1605
Location: Wellington, New Zealand

PostPosted: Tue Mar 09, 2004 5:41 pm    Post subject: Reply with quote

I do not think that is is the compression (ZIP format) alone that causes the problem. Shortage of memory may have some effect too.

Consider the following test steps:
Open new text doc
Open .jpg file in IE (image is 2,951,218 bytes 512 by 512 pixels)
Copy image and paste-special bitmap into OOo doc
Save OOo doc and look at .sxw as zip archive
See PNG component in zip archive 12,713,406 bytes (no compression at all)
Zip package process on PNG component alone takes 3-4 seconds with winzip
soffice.exe 59,600Kbytes in memory usage from TaskManager for that instance alone .. we can assume that most of that is image storage
Change to document and then saving it takes about 15 sec
Saving the document as .Doc was marginally less than .sxw and it took slightly more space on disk bearing out the suggestion that it is the image that makes the doc compared with a normal .sxw/ .doc comparison

Given the sizes involved, there seems to be scope for a fair bit of bit-twiddling to change the format of the image. As the time to store is independent of whether the image has been changed, I suspect that it is doing this from a presentation form to the storage form of PNG. The time to perform the compression using winzip is significantly less than the save time for the sxw.

I have a fairly generous 512Mb physical memory and 2.4Ghz processor.
Back to top
View user's profile Send private message
cwchia
Super User
Super User


Joined: 09 Jan 2003
Posts: 1050
Location: Malaysia

PostPosted: Tue Mar 09, 2004 6:54 pm    Post subject: Reply with quote

I agree with dfrench that the compression issue alone may not be the sole cause of the slaow respond when saving, but certainly it is the most relevant one to this problem. I hope that there can be more options for users to tweak the compression ratio so that different setting can be applied to different machines, in order to balance the pros and cons of speed and file size constraint and still bind the different parts of the OOo file format into one .sx* file by using zip. Anyone with me ?
Back to top
View user's profile Send private message
sju59
General User
General User


Joined: 09 Mar 2004
Posts: 9

PostPosted: Tue Mar 09, 2004 7:39 pm    Post subject: Reply with quote

I absolutely agree. There is no sense in OO writer spending five minutes compressing something when it saves 2KB. Seriously, I think I can spare the HDD space. 5 extra seconds I can stand, 5 minutes I can't.
Back to top
View user's profile Send private message
cwchia
Super User
Super User


Joined: 09 Jan 2003
Posts: 1050
Location: Malaysia

PostPosted: Tue Mar 09, 2004 8:05 pm    Post subject: Reply with quote

Enhancement requests were made:

http://www.openoffice.org/issues/show_bug.cgi?id=19203
http://www.openoffice.org/issues/show_bug.cgi?id=22769
http://www.openoffice.org/issues/show_bug.cgi?id=25971
Back to top
View user's profile Send private message
dfrench
Moderator
Moderator


Joined: 03 Mar 2003
Posts: 1605
Location: Wellington, New Zealand

PostPosted: Tue Mar 09, 2004 8:29 pm    Post subject: Reply with quote

I do not agree. Just to make it clear,
1. The graphics are stored in jpeg or png format as far as I can tell and not further compressed by zipping. They are just included in the archive .sxw
2. To determine the value of compression (in the native OOo formats) you need to compare with the in memory size of the document and not the save microsoft format. The objects in the documents can take up a lot of space!
3. It appears (from my limited tests) that if you paste in a bitmap, it takes up a heap more memory than the JPEG source from which it was derived. Further, the bitmaps are converted to PNG when the document is stored (which is reasonable for portability) and this takes up many times as much space as the original source or even the windows bitmap representation. (as described above). I suggest that this is where the time goes mainly and this operation will be very sensitive to machine horsepower and memory.
4. The conversion of the bitmap into the PNP form is likely to involve a lot of movement of bits around memory and probably complex algorithm execution
5. The original example of a set of charts copied from excel was almost certainly a bitmap image. It would be instructive to know how big the resulting PNP components were.

Is there a work around?
Including the images as JPEG (Insert Graphics from File), certainly seems to eliminate the problem as far as my testing goes. Adding the 2.9Mb JPEG rather than pasting in a bitmap of it makes the save operation negligible in time and it renders faster on the screen. Tere is no visible loss in quality (I would expect it to be better). My guess is that OOo retains the object internally as a JPEG structure and simply pours it into the .sxw (no formatting required).
My guess is that a PNG format file would be treated in the same way.

Some more measurments may be required to substantiate the rather general statement that large files take too long to save.
Back to top
View user's profile Send private message
sju59
General User
General User


Joined: 09 Mar 2004
Posts: 9

PostPosted: Tue Mar 09, 2004 9:26 pm    Post subject: Reply with quote

Just so we can all see exactly what I am dealing with I put my two documents on the web. Feel free to download them and play around with the saving. In my opinion copying a chart from Excel and pasting it in Writer and then saving the document should be completely expected user behavior. No user, especially not someone unsure of the benefits of open software, should be required to do anything to the pictures/charts/graphs to make them save quickly. However, users should also not deal with slow saving times. Hope someone smarter than me has some insight into this. FYI I am using a P3 866 with 512MB memory, not slow, but not overly fast either. Here are the two links:

http://students.j.csbsju.edu/jjathman/Documents/Thesis.doc
http://students.j.csbsju.edu/jjathman/Documents/Thesis.sxw
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group