You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2017/12/22 17:26:58 UTC
[beam] branch go-sdk updated (fc550df -> 03f96c6)
This is an automated email from the ASF dual-hosted git repository.
lcwik pushed a change to branch go-sdk
in repository https://gitbox.apache.org/repos/asf/beam.git.
from fc550df Add type-specialized emitters
new a9dc174 BEAM-3324 improve symtab memory usage
new d85a502 BEAM-3324 improve symtab memory usage
new 03f96c6 BEAM-3324 improve symtab memory usage
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
sdks/go/pkg/beam/core/util/symtab/symtab.go | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
--
To stop receiving notification emails like this one, please contact
['"commits@beam.apache.org" <co...@beam.apache.org>'].
[beam] 02/03: BEAM-3324 improve symtab memory usage
Posted by lc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lcwik pushed a commit to branch go-sdk
in repository https://gitbox.apache.org/repos/asf/beam.git
commit d85a502c838648814b96d56370b98fc799e07705
Author: Bill Neubauer <wc...@google.com>
AuthorDate: Fri Dec 15 10:00:22 2017 -0800
BEAM-3324 improve symtab memory usage
Change the symbol table lookup to read from a file rather than
loading the file into memory. This is a space/time tradeoff, but
lookups can be cached so we can get good speed with a much lower
memory footprint.
---
sdks/go/pkg/beam/core/util/symtab/symtab.go | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/sdks/go/pkg/beam/core/util/symtab/symtab.go b/sdks/go/pkg/beam/core/util/symtab/symtab.go
index a717d08..54ec579 100644
--- a/sdks/go/pkg/beam/core/util/symtab/symtab.go
+++ b/sdks/go/pkg/beam/core/util/symtab/symtab.go
@@ -42,7 +42,8 @@ func New(filename string) (*SymbolTable, error) {
if err == nil {
d, err := ef.DWARF()
if err != nil {
- return nil, err
+ f.Close()
+ return nil, fmt.Errorf("No working DWARF: %v", err)
}
return &SymbolTable{d}, nil
}
@@ -52,6 +53,7 @@ func New(filename string) (*SymbolTable, error) {
if err == nil {
d, err := mf.DWARF()
if err != nil {
+ f.Close()
return nil, fmt.Errorf("No working DWARF: %v", err)
}
return &SymbolTable{d}, nil
@@ -62,12 +64,14 @@ func New(filename string) (*SymbolTable, error) {
if err == nil {
d, err := pf.DWARF()
if err != nil {
- return nil, err
+ f.Close()
+ return nil, fmt.Errorf("No working DWARF: %v", err)
}
return &SymbolTable{d}, nil
}
// Give up, we don't recognize it
+ f.Close()
return nil, fmt.Errorf("Unknown file format")
}
--
To stop receiving notification emails like this one, please contact
"commits@beam.apache.org" <co...@beam.apache.org>.
[beam] 01/03: BEAM-3324 improve symtab memory usage
Posted by lc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lcwik pushed a commit to branch go-sdk
in repository https://gitbox.apache.org/repos/asf/beam.git
commit a9dc1749e9c56092ac37db9aad60df58767146be
Author: Bill Neubauer <wc...@google.com>
AuthorDate: Fri Dec 15 10:00:22 2017 -0800
BEAM-3324 improve symtab memory usage
Change the symbol table lookup to read from a file rather than
loading the file into memory. This is a space/time tradeoff, but
lookups can be cached so we can get good speed with a much lower
memory footprint.
---
sdks/go/pkg/beam/core/util/symtab/symtab.go | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/sdks/go/pkg/beam/core/util/symtab/symtab.go b/sdks/go/pkg/beam/core/util/symtab/symtab.go
index 1606317..a717d08 100644
--- a/sdks/go/pkg/beam/core/util/symtab/symtab.go
+++ b/sdks/go/pkg/beam/core/util/symtab/symtab.go
@@ -16,13 +16,12 @@
package symtab
import (
- "bytes"
"debug/dwarf"
"debug/elf"
"debug/macho"
"debug/pe"
"fmt"
- "io/ioutil"
+ "os"
)
// SymbolTable allows for mapping between symbols and their addresses.
@@ -33,14 +32,13 @@ type SymbolTable struct {
// New creates a new symbol table based on the debug info
// read from the specified file.
func New(filename string) (*SymbolTable, error) {
- b, err := ioutil.ReadFile(filename)
+ f, err := os.Open(filename)
if err != nil {
return nil, err
}
- r := bytes.NewReader(b)
// First try ELF
- ef, err := elf.NewFile(r)
+ ef, err := elf.NewFile(f)
if err == nil {
d, err := ef.DWARF()
if err != nil {
@@ -50,7 +48,7 @@ func New(filename string) (*SymbolTable, error) {
}
// then Mach-O
- mf, err := macho.NewFile(r)
+ mf, err := macho.NewFile(f)
if err == nil {
d, err := mf.DWARF()
if err != nil {
@@ -60,7 +58,7 @@ func New(filename string) (*SymbolTable, error) {
}
// finally try Windows PE format
- pf, err := pe.NewFile(r)
+ pf, err := pe.NewFile(f)
if err == nil {
d, err := pf.DWARF()
if err != nil {
--
To stop receiving notification emails like this one, please contact
"commits@beam.apache.org" <co...@beam.apache.org>.
[beam] 03/03: BEAM-3324 improve symtab memory usage
Posted by lc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
lcwik pushed a commit to branch go-sdk
in repository https://gitbox.apache.org/repos/asf/beam.git
commit 03f96c6b664a861a233e5011363495087711afa7
Author: Bill Neubauer <wc...@google.com>
AuthorDate: Fri Dec 15 10:00:22 2017 -0800
BEAM-3324 improve symtab memory usage
Change the symbol table lookup to read from a file rather than
loading the file into memory. This is a space/time tradeoff, but
lookups can be cached so we can get good speed with a much lower
memory footprint.
---
sdks/go/pkg/beam/core/util/symtab/symtab.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sdks/go/pkg/beam/core/util/symtab/symtab.go b/sdks/go/pkg/beam/core/util/symtab/symtab.go
index 54ec579..0c631c4 100644
--- a/sdks/go/pkg/beam/core/util/symtab/symtab.go
+++ b/sdks/go/pkg/beam/core/util/symtab/symtab.go
@@ -37,6 +37,10 @@ func New(filename string) (*SymbolTable, error) {
return nil, err
}
+ // The interface contract for the xxx.NewFile() methods takes an
+ // io.ReaderAt which suggests the Reader needs to stay alive for the duration
+ // of the symbol table.
+
// First try ELF
ef, err := elf.NewFile(f)
if err == nil {
--
To stop receiving notification emails like this one, please contact
"commits@beam.apache.org" <co...@beam.apache.org>.