Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/26/19 in all areas

  1. Replaced UniImage with UniHTMLFrame In UniFormReady add UniHTMLFrame1.HTML.Text :='<div ID="img_container" style="width:100%; height:100%;"><img src="blank.jpg" id="preloaded_image" /></div>'; in Timer event (when need to repaint picture) - actually not paint to Image but paint to Bitmap or PNG then save it to file. Then create an TImage in JS and fire AJAX when client loaded image (this will done in background!!!) FName:=UniServerModule.NewCacheFileUrl(False, 'png', '', '', url, false); oPNGDest := TPNGObject.Create; try oPNGDest.Assign(bmp); oPNGDest.SaveToFile(FName); finally oPNGDest.Free; end; UniSession.AddJS( 'var my_image = new Image();'+ 'my_image.onload = ajaxRequest(' + self.Image.JSName + ', "ImageUpdated", []);'+ 'my_image.src = '''+url+''';' ); Create AJAX event to HTMLFrame. if( SameText(EventName, 'ImageUpdated') ) then begin UniSession.AddJS('document.getElementById("preloaded_image").src = '''+url+''';'); end; Now the image is in browser cache and it will display very fast, just assign .src to image url. Hope this help someone who use pictures with updating data or drawing to image. Glad to hear any optimizations to more speed up this code.
    1 point
  2. I did some tests with the MUpload example. These are my results: Test 1: 548 files, sizes from 1 kb to 22 mb, total size is 1,22 GB Upload time is 16m 30 sec. from one ssd to another ssd / Upload speed is around ~1,19 MB / sec Notes: Then MUpload were very slow building the queue up, at least 1 min. Notes: The MUpload transfers ~100 files at the same times, when 1 file finished it starts another one from the queue. Notes: Maximum memory usage were ~ 24 MB of system memory. Perfect ------- Test 2 20 files, sizes 30 MB to 40 MB each, total size is 630 MB Upload time is 3 min. from one ssd to another ssd / Upload speed is around ~3,60 MB / sec Notes: Larger files means faster transfer. Notes: Maximum memory usage were 800 MB of system memory. Why? Notes: Every time a file finished MUpload peaked at 600-800 MB of system memory from ~150 to 200 mb. ------- Test 3 10 files, sizes 50 MB to 60 MB each, total size is 531 MB Upload time is 2m 30 sec. from one ssd to another ssd / Upload speed is around ~3,60 MB / sec Notes: Maximum memory usage were 1 GB of system memory. Why? Notes: Every time a file finished MUpload peaked at around 800 MB of system memory from ~150 to 200 mb. ----- Test 4 3 files, all ~100 MB, total size is 300 MB It fails with out of memory, it even fails with only 1 file. I have 16 GB memory with at least 8 GB free. ----- Other having the same issues with large files?
    1 point
×
×
  • Create New...