[isabelle-dev] NEWS: Zstd compression for Isabelle/Scala and Isabelle/ML
Makarius
makarius at sketis.net
Fri Oct 21 22:00:42 CEST 2022
Here are some more tests with Isabelle/cff0828c374f --- where large files work
much better. This is for Isabelle/jEdit with Console/Scala:
def test_heap(name: String, options: Compress.Options): Unit = {
val store = Sessions.store(Options.init())
val heap = store.find_heap(name).getOrElse(error("Bad heap " + quote(name)))
val b = Timing.timeit("read") { Bytes.read(heap) }
val c = Timing.timeit("compress") { b.compress(options, store.cache.compress) }
val d = Timing.timeit("uncompress") { c.uncompress(store.cache.compress) }
Console.println("uncompressed size = " + d.length + "\ncompressed size = "
+ c.length +
"\nratio = " + (d.length.toDouble / c.length.toDouble))
}
scala> test_heap("Pure", Compress.Options_XZ(3))
### read: 0.009s elapsed time
### compress: 1.792s elapsed time
### uncompress: 0.328s elapsed time
uncompressed size = 20848737
compressed size = 3430468
ratio = 6.077519743661798
scala> test_heap("Pure", Compress.Options_Zstd(3))
### read: 0.009s elapsed time
### compress: 0.081s elapsed time
### uncompress: 0.022s elapsed time
uncompressed size = 20848737
compressed size = 4690553
ratio = 4.444835608935663
scala> test_heap("Pure", Compress.Options_Zstd(6))
### read: 0.008s elapsed time
### compress: 0.206s elapsed time
### uncompress: 0.021s elapsed time
uncompressed size = 20848737
compressed size = 4255723
ratio = 4.898988256519515
scala> test_heap("HOL", Compress.Options_XZ(3))
### read: 0.148s elapsed time
### compress: 27.193s elapsed time
### uncompress: 6.162s elapsed time
uncompressed size = 340480517
compressed size = 61810868
ratio = 5.508424780574186
scala> test_heap("HOL", Compress.Options_Zstd(3))
### read: 0.370s elapsed time
### compress: 1.559s elapsed time
### uncompress: 0.511s elapsed time
uncompressed size = 340480517
compressed size = 88856965
ratio = 3.8317819767983297
scala> test_heap("HOL", Compress.Options_Zstd(6))
### read: 0.164s elapsed time
### compress: 3.594s elapsed time
### uncompress: 0.378s elapsed time
uncompressed size = 340480517
compressed size = 82115162
ratio = 4.146378192616852
Makarius
More information about the isabelle-dev
mailing list