linuxboot / linuxboot/contest

Re-evaluate performances for []*Struct over []Struct

Open
#9 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
20
Forks
17
PR merge metrics
No merged PRs in 30d

Description

Issue by marcoguerri
Wednesday Feb 05, 2020 at 12:48 GMT
Originally opened as https://github.com/facebookincubator/contest/issues/21


Using []Struct is in most cases probably desirable, but in some cases []*Struct might make sense (e.g. Targets). We should re-evaluate these cases. Here is where we use []*, excluding Targets:

pkg/test/fetcher.go:16: Fetch(interface{}) (string, []*TestStepDescriptor, error)
pkg/job/reporter.go:20: Report(cancel <-chan struct{}, parameters interface{}, results []*test.TestResult, ev testevent.Fetcher) (bool, interface{}, error)
pkg/job/job.go:27:      TestDescriptors []*test.TestDescriptor
pkg/job/job.go:63:      Tests       []*test.Test
pkg/runner/job_runner.go:49:            testResults []*test.TestResult
pkg/jobmanager/jobmanager.go:88:        tests := make([]*test.Test, 0, len(jd.TestDescriptors))
plugins/testfetchers/uri/uri.go:86:func (tf *URI) Fetch(params interface{}) (string, []*test.TestStepDescriptor, error) {
plugins/testfetchers/uri/uri.go:117:            Steps []*test.TestStepDescriptor
plugins/testfetchers/literal/literal.go:29:     Steps    []*test.TestStepDescriptor
plugins/testfetchers/literal/literal.go:54:func (tf *Literal) Fetch(params interface{}) (string, []*test.TestStepDescriptor, error) 

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the listed usages in pkg/test/fetcher.go, pkg/job/reporter.go, pkg/job/job.go, pkg/runner/job_runner.go, pkg/jobmanager/jobmanager.go, and the URI and literal test fetchers. Compare the []Struct and []*Struct cases, including Targets, and evaluate each representation consistently. Done means every listed case has been re-evaluated and any justified changes are applied across the affected files.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
performance, testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.