gnirts

package module
v0.0.0-...-153485d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

README

GNIRTS

Package gnirts was inspired by this twitter comment

It's a simple set of benchmarks to show the many different (and occasionally incorrect) ways to reverse a string.

Go lacks a built in method for string reversal, leaving people to just do it themselves.

This leads to different implementations which don't always work for all cases. For example, many of the methods in this library will not work with combination-characters in Unicode. Follow the links to see the original place they came from - the fastest result is not always the most correct one.

How to use gnirts

Do not import it.

Do not import it.

Do not import it.

It's meant as a benchmark repository just to show the different ways you could do it, and what the tradeoffs are.

Test it by running the following: make bench or make benchmem

Contributing

Feel free to open PRs to add new methods, or to suggest better way to organize them, etc, or to better catalogue what each method excels at (for example, works with combination-characters or not, etc)

If you want to contribute code, make sure it passes the 3 analysis tools by running make deps followed by make check

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reverse1

func Reverse1(s string) string

Reverse1 is a string reverser

func Reverse2

func Reverse2(s string) string

Reverse2 is a string reverser

func Reverse3

func Reverse3(s string) string

Reverse3 is a string reverser

func Reverse4

func Reverse4(s string) string

Reverse4 is a string reverser

func Reverse5

func Reverse5(s string) string

Reverse5 is a string reverser

func Reverse6

func Reverse6(s string) string

Reverse6 is a string reverser

func Reverse7

func Reverse7(s string) string

Reverse7 is a string reverser

func Reverse8

func Reverse8(s string) string

Reverse8 is a string reverser

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL