GithubHelp home page GithubHelp logo

gotsc's People

Contributors

dterei avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gotsc's Issues

calculating the overhead includes overhead of calculating overhead

I'm not familiar with the GO language, but reading the TSCOverhead function, it looks like the loop also makes calculations. Again, not sure, but I think a more precise overhead might be calculated if the returned values of calling Benchstart and Benchend are stored in an array first, and differences between t0 and t1 would only be calculated after the the loop of calling Benchstart and Benchend finishes. Assuming placing the return values in an array is faster then an if-test with a substract-calculation + another substract calculation to store it.
So my suggestion (or actually my question if it would be better) would be to let this function have two loops, where the first one calls the Benchstart and Benchend functions and the second loop processes the array results.

This

for i := 0; i < 100000; i++ {
	t0 = BenchStart()
	t1 = BenchEnd()
	if t1-t0 < overhead {
		overhead = t1 - t0
	}
}

would become (something like) this, if 2 seperate arrays would be used:


for i := 0; i < 100000; i++ {
	arStarts(i) = BenchStart() 'both in separate arrays, as using 2D array might be more costly (and separate arrays ensures the order of calling the functions?)
	arEnds(i) = BenchEnd()
}
for i := 0; i < 100000; i++ {
	t0 = arStarts(i)   //BenchStart() returned value
	t1 = arEnds(i)    //BenchEnd() returned value
	if t1-t0 < overhead {
		overhead = t1 - t0
	}
}

Or store in 2D array. I don't know about Go, but in some languages all arguments are evaluated first, before doing anything with it (fe VBA). It would mean that using an array won't cause any overhead (of storing value in array) at all:

for i := 0; i < 100000; i++ {
        ar(i) = (BenchStart(), BenchEnd()) 
}
for i := 0; i < 100000; i++ {
	t0 = a(i, 0)     //BenchStart() returned value
	t1 = ar(i, 1)    //BenchEnd() returned value
	if t1-t0 < overhead {
		overhead = t1 - t0
	}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.