ooxml

Check-in [6c6aa2f98f]
Login

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

Overview
Comment:Reworked the option parsing of the cell method for speed.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | populationspeed
Files: files | file ages | folders
SHA3-256: 6c6aa2f98f67ca9932888e8b2ce4a4a0d9519b08b00c24c64eda36887f65b1d1
User & Date: rolf 2019-08-13 21:10:46
References
2019-08-16
19:23
fixed a problem with -style option (from check-in [6c6aa2f98f]) check-in: 27bb35e6a6 user: alex tags: populationspeed
Context
2019-08-14
15:52
Turns out, that creating the zip (at least as it currently done with vfs) eats up some time. Removed the need for vfs (only for writing!), now the zip is created with core on-board means. This reduces the time per cell needed for writing to 2/3. check-in: e06fcddeb0 user: rolf tags: populationspeed
2019-08-13
21:10
Reworked the option parsing of the cell method for speed. check-in: 6c6aa2f98f user: rolf tags: populationspeed
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
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ooxml.tcl.

1971
1972
1973
1974
1975
1976
1977

































































1978
1979
1980

1981
1982
1983
1984
1985
1986
1987
  }

  method cell { sheet {data {}} args } {
    my variable obj
    my variable cells
    my variable cols


































































    if {[::ooxml::Getopt opts {index.arg {} style.arg 0 formula.arg {} string nozero globalstyle height.arg {}} $args]} {
      error $opts(-errmsg)
    }


    if {!$obj(callRow,$obj(sheets))} {
      set obj(callRow,$obj(sheets)) 1
      incr obj(row,$sheet)
    }

    if {[regexp {^\d+$} $opts(index)] && $opts(index) > -1} {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
<
>







1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044

2045
2046
2047
2048
2049
2050
2051
2052
  }

  method cell { sheet {data {}} args } {
    my variable obj
    my variable cells
    my variable cols

    array set opts {
      index ""
      style ""
      formula ""
      string 0
      nozero 0
      globalstyle 0
      height ""
    }
    set len [llength $args]
    set loopInd 0
    while {$loopInd < $len} {
      switch -glob [lindex $args $loopInd] {
        "-index" {
          incr loopInd
          if {$loopInd < $len} {
            set opts(index) [lindex $args $loopInd]
            incr loopInd
          } else {
            error "-index: missing argument"
          }            
        }
        "-style" {
          incr loopInd
          if {$loopInd < $len} {
            set opts(style) [lindex $args $loopInd]
            incr loopInd
          } else {
            error "-style: missing argument"
          }
        }
        "-formula"  {
          incr loopInd
          if {$loopInd < $len} {
            set opts(formula) [lindex $args $loopInd]
            incr loopInd
          } else {
            error "-formula: missing argument"
          }
        }
        "-string" {
          set opts(string) 1
          incr loopInd
        }
        "-nozero" {
          set opts(nozero) 1
        }
        "-globalstyle" {
          set opts(globalstyle) 1
          incr loopInd
        }
        "-height" {
          incr loopInd
          if {$loopInd < $len} {
            set opts(height) [lindex $args $loopInd]
            incr loopInd
          } else {
            error "-height: missing argument"
          }
        }
        default {
          error "unknown option [lindex $args $loopInd]"
        }
      }
    }
    # if {[::ooxml::Getopt opts {index.arg {} style.arg 0 formula.arg {} string nozero globalstyle height.arg {}} $args]} {
    #   error $opts(-errmsg)

    # }

    if {!$obj(callRow,$obj(sheets))} {
      set obj(callRow,$obj(sheets)) 1
      incr obj(row,$sheet)
    }

    if {[regexp {^\d+$} $opts(index)] && $opts(index) > -1} {