diff --git a/bench/assets/count_to_one_billion.js b/bench/assets/count_to_one_billion.js deleted file mode 100644 index 998aedd..0000000 --- a/bench/assets/count_to_one_billion.js +++ /dev/null @@ -1,5 +0,0 @@ -var i = 0; - -while (i < 1_000_000_000) { - i++; -} diff --git a/bench/assets/count_to_one_billion.ds b/bench/assets/count_to_one_million.ds similarity index 53% rename from bench/assets/count_to_one_billion.ds rename to bench/assets/count_to_one_million.ds index 8e4c8a5..2344efb 100644 --- a/bench/assets/count_to_one_billion.ds +++ b/bench/assets/count_to_one_million.ds @@ -1,5 +1,5 @@ let mut i = 0 -while i < 100_000_000 { +while i < 1_000_000 { i += 1 } diff --git a/bench/assets/count_to_one_million.js b/bench/assets/count_to_one_million.js new file mode 100644 index 0000000..f9899c0 --- /dev/null +++ b/bench/assets/count_to_one_million.js @@ -0,0 +1,5 @@ +var i = 0; + +while (i < 1_000_000) { + i++; +} diff --git a/bench/assets/count_to_one_million.py b/bench/assets/count_to_one_million.py new file mode 100644 index 0000000..b9f34a3 --- /dev/null +++ b/bench/assets/count_to_one_million.py @@ -0,0 +1,4 @@ +i = 1 + +while i < 1_000_000: + i += 1 diff --git a/bench/count_one_one_million.sh b/bench/count_one_one_million.sh new file mode 100644 index 0000000..020075a --- /dev/null +++ b/bench/count_one_one_million.sh @@ -0,0 +1,7 @@ +hyperfine \ + --shell none \ + --warmup 5 \ + '../target/release/dust assets/count_to_one_million.ds' \ + 'node assets/count_to_one_million.js' \ + 'deno assets/count_to_one_million.js' \ + 'python assets/count_to_one_million.py' diff --git a/dust-lang/src/chunk.rs b/dust-lang/src/chunk.rs index a603a2e..add03c5 100644 --- a/dust-lang/src/chunk.rs +++ b/dust-lang/src/chunk.rs @@ -89,7 +89,7 @@ impl Chunk { .rev() .find_map(|(instruction, _)| { if instruction.yields_value() { - Some(instruction.a() as usize) + Some(instruction.a() as usize + 1) } else { None } diff --git a/flamegraph.svg b/flamegraph.svg deleted file mode 100644 index 3813bf2..0000000 --- a/flamegraph.svg +++ /dev/null @@ -1,491 +0,0 @@ -Flame Graph Reset ZoomSearch <core::result::Result<T,E> as core::ops::try_trait::Try>::branch (1,560,579,007 samples, 9.93%)<core::result:..<dust_lang::instruction::jump::Jump as core::convert::From<&dust_lang::instruction::Instruction>>::from (5,136,709 samples, 0.03%)dust_lang::instruction::Instruction::b (5,136,709 samples, 0.03%)core::result::Result<T,E>::map_err (1,922,298,094 samples, 12.24%)core::result::Resu..core::result::Result<T,E>::map (2,075,171,161 samples, 13.21%)core::result::Result..dust_lang::value::ValueRef::add (5,533,570,295 samples, 35.22%)dust_lang::value::ValueRef::adddust_lang::value::concrete_value::ConcreteValue::add (3,417,155,502 samples, 21.75%)dust_lang::value::concrete_value::..core::result::Result<T,E>::map (5,053,956,012 samples, 32.17%)core::result::Result<T,E>::map[unknown] (5,165,849 samples, 0.03%)[unknown] (5,165,849 samples, 0.03%)[unknown] (5,165,849 samples, 0.03%)[unknown] (5,165,849 samples, 0.03%)[unknown] (5,165,849 samples, 0.03%)dust_lang::value::ValueRef::less_than (6,679,061,476 samples, 42.51%)dust_lang::value::ValueRef::less_thandust_lang::value::concrete_value::ConcreteValue::less_than (1,439,043,424 samples, 9.16%)dust_lang::va..core::cmp::impls::<impl core::cmp::PartialOrd<&B> for &A>::lt (273,670,000 samples, 1.74%)core::cmp::impls::<impl core::cmp::PartialOrd for i64>::lt (273,670,000 samples, 1.74%)dust_lang::vm::Vm::get_argument (5,140,762 samples, 0.03%)dust_lang::vm::Vm::read (5,169,945 samples, 0.03%)all (15,711,250,040 samples, 100%)dust_lang::vm::run (15,710,957,362 samples, 100.00%)dust_lang::vm::rundust_lang::vm::Vm::run (15,710,957,362 samples, 100.00%)dust_lang::vm::Vm::run \ No newline at end of file diff --git a/perf.data b/perf.data deleted file mode 100644 index dc2b963..0000000 Binary files a/perf.data and /dev/null differ diff --git a/perf.data.old b/perf.data.old deleted file mode 100644 index 4886fe9..0000000 --- a/perf.data.old +++ /dev/null @@ -1,22 +0,0 @@ -# started on Tue Dec 3 23:57:01 2024 - - - Performance counter stats for 'target/release/dust bench/assets/count_to_one_billion.ds': - - 3,821.33 msec task-clock:u # 1.000 CPUs utilized - 0 context-switches:u # 0.000 /sec - 0 cpu-migrations:u # 0.000 /sec - 128 page-faults:u # 33.496 /sec - 19,568,365,731 cycles:u # 5.121 GHz - 22,811,191 stalled-cycles-frontend:u # 0.12% frontend cycles idle - 70,300,518,284 instructions:u # 3.59 insn per cycle - # 0.00 stalled cycles per insn - 12,500,111,636 branches:u # 3.271 G/sec - 19,795 branch-misses:u # 0.00% of all branches - - 3.822391878 seconds time elapsed - - 3.811230000 seconds user - 0.000999000 seconds sys - -