ooxml

Check-in [998892470a]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Found and fixed one major problem: The code already sorts all cells once. Just store the results and use them easily looked up later. Still the # of milliseconds per cell needed while writing goes up slightly with the # of cells to write. But it's much better now. See [20c5ed5f11].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | speed
Files: files | file ages | folders
SHA3-256: 998892470a99d4b2828984b158e815d5dd5859875adedafa5ba4c6e31b71afdf
User & Date: rolf 2019-08-08 22:09:23
Original Comment: Found and fixed one major problem: The code already sorts the complete cells once. Just store the results and use them easily looked up later. Still the # of milliseconds goes up slightly with the # of cells to write. But it's mutch more better now. See [20c5ed5f11].
References
2019-08-08
22:13 Ticket [20c5ed5f11] Speed goes down massively with nr of cells writen status still Open with 5 other changes artifact: 80992323f3 user: rolf
Context
2019-08-08
22:57
Added a simple bench test file, to have at least something handy within the source tree. Leaf check-in: 5cebb3f58f user: rolf tags: speed
22:09
Found and fixed one major problem: The code already sorts all cells once. Just store the results and use them easily looked up later. Still the # of milliseconds per cell needed while writing goes up slightly with the # of cells to write. But it's much better now. See [20c5ed5f11]. check-in: 998892470a user: rolf tags: speed
20:32
Minor improvement: Don't create a list of length nr of cells in the sheet (and as much Tcl_Objs, with typically tons of doublets) but an array with just nr of rows in the sheet as entries. And, as an effect, the following sort has much lesser work. check-in: 87b0383960 user: rolf tags: speed
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ooxml.tcl.

2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
	if {[info exists obj($ws,cols)] && $obj($ws,cols) > 0} {
	  Tag_cols {}
	}
	Tag_sheetData {
	  array unset rows
	  foreach idx [lsort -dictionary [array names cells $ws,*,*]] {
	    lassign [split $idx ,] sheet row col
            set rows($row) ""
	  }
	  foreach row [lsort -integer [array names rows]] {
	    set attr {}
	    if {[dict exists $obj(rowHeight,$ws) $row]} {
	      lappend attr ht [dict get $obj(rowHeight,$ws) $row] customHeight 1
	    }
	    # lappend attr spans [expr {$minCol + 1}]:[expr {$maxCol + 1}]
	    Tag_row r [expr {$row + 1}] {*}$attr {
	      foreach idx [lsort -dictionary [array names cells $ws,$row,*]] {
		lassign [split $idx ,] sheet row col
		if {([dict exists $cells($idx) v] && [string trim [dict get $cells($idx) v]] ne {}) || ([dict exists $cells($idx) f] && [string trim [dict get $cells($idx) f]] ne {})} {
		  set attr {}
		  if {[dict exists $cells($idx) s] && [dict get $cells($idx) s] > 0} {
		    lappend attr s [dict get $cells($idx) s]
		  }
		  if {[dict exists $cells($idx) t] && [dict get $cells($idx) t] ne {n}} {
		    lappend attr t [dict get $cells($idx) t]







|








|
|







2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
	if {[info exists obj($ws,cols)] && $obj($ws,cols) > 0} {
	  Tag_cols {}
	}
	Tag_sheetData {
	  array unset rows
	  foreach idx [lsort -dictionary [array names cells $ws,*,*]] {
	    lassign [split $idx ,] sheet row col
            lappend rows($row) $col
	  }
	  foreach row [lsort -integer [array names rows]] {
	    set attr {}
	    if {[dict exists $obj(rowHeight,$ws) $row]} {
	      lappend attr ht [dict get $obj(rowHeight,$ws) $row] customHeight 1
	    }
	    # lappend attr spans [expr {$minCol + 1}]:[expr {$maxCol + 1}]
	    Tag_row r [expr {$row + 1}] {*}$attr {
              foreach col $rows($row) {
                set idx "$ws,$row,$col"
		if {([dict exists $cells($idx) v] && [string trim [dict get $cells($idx) v]] ne {}) || ([dict exists $cells($idx) f] && [string trim [dict get $cells($idx) f]] ne {})} {
		  set attr {}
		  if {[dict exists $cells($idx) s] && [dict get $cells($idx) s] > 0} {
		    lappend attr s [dict get $cells($idx) s]
		  }
		  if {[dict exists $cells($idx) t] && [dict get $cells($idx) t] ne {n}} {
		    lappend attr t [dict get $cells($idx) t]