aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/format/packfile/decoder.go
Commit message (Collapse)AuthorAgeFilesLines
* *: use parser to populate non writable storages and bug fixesMiguel Molina2018-08-071-553/+0
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* plumbing: packfile, fix package testsMiguel Molina2018-07-301-9/+19
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* plumbing/packfile: add index generation to decoderJavi Fontan2018-07-271-7/+25
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* plumbing: packfile, lazy object reads with DiskObjectsMiguel Molina2018-07-271-1/+1
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* plumbing: packfile, new Packfile representationMiguel Molina2018-07-261-18/+39
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* plumbing, storage: integrate new indexJavi Fontan2018-07-261-4/+5
| | | | | | Now dotgit.PackWriter uses the new packfile.Parser and index. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* plumbing/packfile: disable lookup by offsetJavi Fontan2018-07-261-8/+9
| | | | | | | In one case it disables the cache and the other disables lookup when the scanner is not seekable. Could be added back later. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* plumbing/format/idxfile: add new Index and MemoryIndexMiguel Molina2018-07-191-10/+17
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* Modify cache to delete more than one item to free spaceJavi Fontan2018-01-161-0/+2
| | | | | | | | | | | The previous version could only delete the oldest used object. If the object to cache was bigger than the space freed it could not be added. Also the decoder adds bases to the cache when they are needed. This change increases the speed creating indexes 2x. Signed-off-by: Javi Fontan <jfontan@gmail.com>
* Make DeltaBaseCache privateJavi Fontan2017-12-201-6/+13
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* Fix typo and documentation of NewDecoderForTypeJavi Fontan2017-12-201-3/+3
| | | | Signed-off-by: Javi Fontan <jfontan@gmail.com>
* Enforce the use of cache in packfile decoderJavi Fontan2017-12-201-5/+11
| | | | | | | | | | | | | | | | | Decoder object can make use of an object cache to speed up processing. Previously the only way to specify it was changing manually the struct generated by NewDecodeForFile. This lead to some instances to be created without it and penalized performance. Now the cache should be explicitly passed to the constructor function. NewDecoder now creates objects with a cache using the default size. A new helper function was added to create cache objects with the default size as this becomes a common task now: cache.NewObjectLRUDefault() Signed-off-by: Javi Fontan <jfontan@gmail.com>
* all: simplificationferhat elmas2017-11-291-1/+1
| | | | | | | | | | - no length for map initialization - don't check for boolean/error return - don't format string - use string method of bytes buffer instead of converting bytes to string - use `strings.Contains` instead of `strings.Index` - use `bytes.Equal` instead of `bytes.Compare`
* format: packfile fix DecodeObjectAt when Decoder has typeMáximo Cuadros2017-11-191-3/+9
| | | | Signed-off-by: Máximo Cuadros <mcuadros@gmail.com>
* packfile: improve performance a little by reducing gc pressureMiguel Molina2017-09-041-1/+3
| | | | Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
* storage/filesystem: reuse delta cacheSantiago M. Mola2017-07-271-10/+22
| | | | | Reuse delta base object cache for packfile decoders across multiple instances.
* plumbing/cache: use more explicit interfaceSantiago M. Mola2017-07-271-7/+6
| | | | | | * renamed Add to Put * Get returns a second bool value to indicate if there was hit or miss.
* packfile: create packfile.Index and reuse itSantiago M. Mola2017-07-261-51/+53
| | | | | | | | | | | | | | | There was an internal type (i.e. storage/filesystem.idx) to use as in-memory index for packfiles. This was not convenient to reuse in the packfile. This commit creates a new representation (format/packfile.Index) that can be converted to and from idxfile.Idxfile. A packfile.Index now contains the functionality that was scattered on storage/filesystem.idx and packfile.Decoder's internals. storage/filesystem now reuses packfile.Index instances and this also results in higher cache hit ratios when resolving deltas.
* format/packfile: rename Seek to SeekFromStartSantiago M. Mola2017-04-261-2/+2
| | | | | | This has signature and behavior distinct from io.Seeker, go vet complains about this, so we change it to a different name to avoid confusion.
* project: move imports from srcd.works to gopkg.inAntonio Jesus Navarro Perez2017-03-071-3/+3
| | | | To be able to fix #261 we will move again to gopkg.in before v4 stable release.
* plumbing: improve documentation (Fix #242)Antonio Jesus Navarro Perez2017-02-231-2/+5
|
* cache: move package to plumbingAntonio Jesus Navarro Perez2017-02-211-1/+1
| | | | Because cache package is only intended to be used at internal level, we move it to the plumbing package.
* Fix missing objects if they where deltified using ref-deltaAntonio Jesus Navarro Perez2017-02-071-7/+0
| | | | | - Deleted invalid logic that returned nil if an ref-delta was not found into the decoder index. This logic was missing objects if it was deltified using ref-deltas. - Now, to avoid that problem, index is mandatory to decode correctly a packfile of a specific type. Decoder.SetOffsets method now is called into the EncodedObjectIterator to avoid this problem.
* new srcd.works/go-git.v4 pathMáximo Cuadros2017-01-301-3/+3
|
* Fix some typos in plumbing docs (#244)Sergio Arbeo2017-01-301-8/+8
|
* packfile: cache undeltified objects to improve decode performance (#218)Antonio Navarro Perez2017-01-251-8/+33
| | | | | * Simple object cache that keeps in memory the last undeltified objects. When no more objects can be kept into memory, the oldest one is deleted (FIFO). This speeds up packfile operations preventing redundant seeks and decodes.
* packfile/decoder: speed up packfile iterator when specific type (#200)Antonio Navarro Perez2017-01-121-1/+88
|
* move plumbing from top level package to plumbing (#183)Santiago M. Mola2016-12-141-17/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * plumbing: rename Object -> EncodedObject. * plumbing/storer: rename ObjectStorer -> EncodedObjectStorer. * move difftree to plumbing/difftree. * move diff -> utils/diff * make Object/Tag/Blob/Tree/Commit/File depend on storer. * Object and its implementations now depend only on storer.EncodedObjectStorer, not git.Repository. * Tests are decoupled accordingly. * move Object/Commit/File/Tag/Tree to plumbing/object. * move Object/Commit/File/Tag/Tree to plumbing/object. * move checkClose to utils/ioutil. * move RevListObjects to plumbing/revlist.Objects. * move DiffTree to plumbing/difftree package. * rename files with plural nouns to singular * plumbing/object: add GetBlob/GetCommit/GetTag/GetTree.
* plumbing: format, packfile fix issue #129, related #124, and documentation ↵Máximo Cuadros2016-11-231-29/+73
| | | | | | | | improvements (#130) * plumbing: format, packfile fix issue #129, related #124 * plumbing: format, packfile documentation improvements
* Fix nil tx bug (#124)v4.0.0-rc4Alberto Cortés2016-11-141-3/+3
| | | | | | * add test for non-seekable packfiles * packfile: do not throw away the newly created transactioner
* new plumbing package (#118)Máximo Cuadros2016-11-081-0/+307
* plumbing: now core was renamed to core, and formats and clients moved inside