Lead Image © Lucy Baldwin, 123RF.com

Lead Image © Lucy Baldwin, 123RF.com

Go testing frameworks

Going Faster

Article from ADMIN 82/2024
By
Explore the Go language performance framework and thrash the cache in style.

Traditionally the best language to implement command-line interface (CLI) shell utilities in Linux was Perl [1] – primarily because of its large collection of pre-existing modules, a resource unparalleled at the time called CPAN [2]. Things have since changed, with Perl's popularity steadily declining in the eyes of developers and other languages rising to produce comparably large module libraries, as in Python [3] or Node [4].

Recent books have been published about writing shell commands in Rust [5], Python [6], Node.js [7], and even Go [8], and it is into this last language's interesting performance testing facilities I shall delve deeper. Go famously includes a testing framework, but perhaps less well known is its equally impressive built-in performance testing facility.

To start, the directories should be set up as presented in Figure 1, with the project row.go detailed in Listing 1.

Listing 1

row.go

01 package main
02
03 func main() {
04
05     const size = 10
06
07     var array = [size][size]int {{0},{0},}
08
09     for i := 0; i < size; i++ {
10         for j := 0; j < size; j++ {
11             array[i][j]++
12         }
13     }
14
15 }
...
Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Thrashing the data cache for fun and profit
    To reduce the possibility of disk thrashing, optimize your data cache through spatial locality and cache-friendly algorithms and utilize fully the data loaded from slower storage media before moving on.
  • High-Performance Python 3

    Python finally has interoperable tools for programming the GPU – with or without CUDA.

  • Pandas: Data analysis with Python
    The Python Data Analysis Library, or Pandas, is built on top of the fast math library NumPy and makes analysis of large volumes of data an easy and efficient experience.
  • Data Analysis with Panda

    The Python Data Analysis Library, or Pandas, is built on top of the fast math library NumPy and makes analysis of large volumes of data an easy and efficient experience.

  • Tuning SSD RAID for optimal performance
    Hardware RAID controllers are optimized for the I/O characteristics of hard disks; however, the different characteristics of SSDs require optimized RAID controllers and RAID settings.
comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=