testhtml

package
v0.2.697 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 4 Imported by: 0

README

templ benchmark

Used to test code generation strategies for improvements to render time.

Tasks

run
go test -bench .

Results as of 2023-08-17

go test -bench .
goos: darwin
goarch: arm64
pkg: github.com/a-h/templ/benchmarks/templ
BenchmarkTempl-10                3291883               369.1 ns/op           536 B/op          6 allocs/op
BenchmarkGoTemplate-10            481052              2475 ns/op            1400 B/op         38 allocs/op
BenchmarkIOWriteString-10       20353198                56.64 ns/op          320 B/op          1 allocs/op
PASS
ok      github.com/a-h/templ/benchmarks/templ   4.650s

React comes in at 1,000,000,000ns / 114,131 ops/s = 8,757.5 ns per operation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(p Person) templ.Component

Types

type Person

type Person struct {
	Name  string
	Email string
}

Jump to

Keyboard shortcuts

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