google / google/safetext

Major performance regression compared to `text/template`

Open
#4 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
151
Forks
9
PR merge metrics
No merged PRs in 30d

Description

In our templates we see a major regression when using `yamltemplate`.

```
name old time/op new time/op delta
Test-48 324µs ± 2% 2360µs ± 2% +628.58% (p=0.008 n=5+5)

name old alloc/op new alloc/op delta
Test-48 52.2kB ± 0% 724.3kB ± 0% +1287.50% (p=0.008 n=5+5)

name old allocs/op new allocs/op delta
Test-48 794 ± 0% 11722 ± 0% +1376.32% (p=0.029 n=4+4)
```

Given yaml templating is a hot-path in our code, this makes the library not viable for usage as-is.

Additionally, the global locking mechanism used, while not explicitly measured, is also likely a problem for us as we do templating in many concurrent goroutines.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.