Adjust amount of data in the benchmarks for more consistent timing

This commit is contained in:
Kovid Goyal
2023-11-12 14:50:18 +05:30
parent f2153f060d
commit 17cb65e981
2 changed files with 5 additions and 4 deletions

View File

@@ -116,6 +116,7 @@ Build-time dependencies:
- ``libssl-dev`` - ``libssl-dev``
- ``libpython3-dev`` - ``libpython3-dev``
- ``libxxhash-dev`` - ``libxxhash-dev``
- ``libsmide-dev``
Build and run from source with Nix Build and run from source with Nix

View File

@@ -113,7 +113,7 @@ type result struct {
} }
func simple_ascii() (r result, err error) { func simple_ascii() (r result, err error) {
data := random_string_of_bytes(1024*1024+13, ascii_printable) data := random_string_of_bytes(1024*2048+13, ascii_printable)
duration, err := benchmark_data(data, default_benchmark_options()) duration, err := benchmark_data(data, default_benchmark_options())
if err != nil { if err != nil {
return result{}, err return result{}, err
@@ -122,7 +122,7 @@ func simple_ascii() (r result, err error) {
} }
func unicode() (r result, err error) { func unicode() (r result, err error) {
data := strings.Repeat(chinese_lorem_ipsum+misc_unicode, 64) data := strings.Repeat(chinese_lorem_ipsum+misc_unicode, 1024)
duration, err := benchmark_data(data, default_benchmark_options()) duration, err := benchmark_data(data, default_benchmark_options())
if err != nil { if err != nil {
return result{}, err return result{}, err
@@ -131,7 +131,7 @@ func unicode() (r result, err error) {
} }
func ascii_with_csi() (r result, err error) { func ascii_with_csi() (r result, err error) {
const sz = 1024 * 1024 * 17 const sz = 1024*1024 + 17
out := make([]byte, 0, sz+48) out := make([]byte, 0, sz+48)
src := rand_src() src := rand_src()
chunk := "" chunk := ""
@@ -168,7 +168,7 @@ func images() (r result, err error) {
g.SetQuiet(graphics.GRT_quiet_silent) g.SetQuiet(graphics.GRT_quiet_silent)
g.SetAction(graphics.GRT_action_query) g.SetAction(graphics.GRT_action_query)
g.SetFormat(graphics.GRT_format_rgba) g.SetFormat(graphics.GRT_format_rgba)
const dim = 1024 const dim = 2048
g.SetDataWidth(dim) g.SetDataWidth(dim)
g.SetDataHeight(dim) g.SetDataHeight(dim)
b := strings.Builder{} b := strings.Builder{}