Merge pull request #1497 from obscuren/remove-rle

ethdb, trie: removed RLE compression
This commit is contained in:
Jeffrey Wilcke 2015-07-25 08:35:40 -07:00
commit 4019e2a6f2
2 changed files with 7 additions and 7 deletions

View File

@ -23,7 +23,6 @@ import (
"sync" "sync"
"time" "time"
"github.com/ethereum/go-ethereum/compression/rle"
"github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/logger"
"github.com/ethereum/go-ethereum/logger/glog" "github.com/ethereum/go-ethereum/logger/glog"
"github.com/ethereum/go-ethereum/metrics" "github.com/ethereum/go-ethereum/metrics"
@ -100,12 +99,12 @@ func (self *LDBDatabase) Put(key []byte, value []byte) error {
defer self.putTimer.UpdateSince(time.Now()) defer self.putTimer.UpdateSince(time.Now())
} }
// Generate the data to write to disk, update the meter and write // Generate the data to write to disk, update the meter and write
dat := rle.Compress(value) //value = rle.Compress(value)
if self.writeMeter != nil { if self.writeMeter != nil {
self.writeMeter.Mark(int64(len(dat))) self.writeMeter.Mark(int64(len(value)))
} }
return self.db.Put(key, dat, nil) return self.db.Put(key, value, nil)
} }
// Get returns the given key if it's present. // Get returns the given key if it's present.
@ -126,7 +125,8 @@ func (self *LDBDatabase) Get(key []byte) ([]byte, error) {
if self.readMeter != nil { if self.readMeter != nil {
self.readMeter.Mark(int64(len(dat))) self.readMeter.Mark(int64(len(dat)))
} }
return rle.Decompress(dat) return dat, nil
//return rle.Decompress(dat)
} }
// Delete deletes the key from the queue and database // Delete deletes the key from the queue and database

View File

@ -17,7 +17,6 @@
package trie package trie
import ( import (
"github.com/ethereum/go-ethereum/compression/rle"
"github.com/ethereum/go-ethereum/ethdb" "github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/logger/glog" "github.com/ethereum/go-ethereum/logger/glog"
"github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb"
@ -49,7 +48,8 @@ func (self *Cache) Get(key []byte) []byte {
func (self *Cache) Put(key []byte, data []byte) { func (self *Cache) Put(key []byte, data []byte) {
// write the data to the ldb batch // write the data to the ldb batch
self.batch.Put(key, rle.Compress(data)) //self.batch.Put(key, rle.Compress(data))
self.batch.Put(key, data)
self.store[string(key)] = data self.store[string(key)] = data
} }