Post by AnthroHeart on Mar 26, 2024 9:36:38 GMT
Now I know for sure that the Repeater statement was NOT optimized out of program in my previous version of MAX.
When I changed from repeating the intention to repeating the intention_value (the multiplied one) the program slowed down.
It wouldn't have slowed down if it were optimized out. Plus we could feel it working anyway, so this just proves it is acting.
I thought it might have been optimized out because the value of intention_value does not change, and GPT-4 said it could possibly have been.
The change I made though did speed the program up. It seems to be a better way of repeating. This new way is used in my Intention Repeater Simple and Multithreaded.
To this (v5.9):
And when I use benchmarking in v5.9 (faster, but not as accurate timing (--timer INEXACT):
When I changed from repeating the intention to repeating the intention_value (the multiplied one) the program slowed down.
It wouldn't have slowed down if it were optimized out. Plus we could feel it working anyway, so this just proves it is acting.
I thought it might have been optimized out because the value of intention_value does not change, and GPT-4 said it could possibly have been.
The change I made though did speed the program up. It seems to be a better way of repeating. This new way is used in my Intention Repeater Simple and Multithreaded.
The Repeater part changed from this below (v5.8):
(process_intention and intention_value are both string. iterations is long long int.)
start = std::chrono::high_resolution_clock::now();
end = std::chrono::high_resolution_clock::now();
while ((chrono::duration_cast<chrono::seconds>(end - start).count() < 1))
{
process_intention = intention_value; // This is the Intention Repeater call that
// actually does the work with the Servitor
// [HR6819].
iterations++;
end = std::chrono::high_resolution_clock::now();
}
To this (v5.9):
start = std::chrono::high_resolution_clock::now();
end = std::chrono::high_resolution_clock::now();
while ((chrono::duration_cast<chrono::seconds>(end - start).count() < 1))
{
// Clear previous value and reuse the allocated space
process_intention.clear();
// Append the fixed part and the changing part
process_intention.append(intention_value);
process_intention.append(to_string(iterations));
iterations++;
end = std::chrono::high_resolution_clock::now();
}
And when I use benchmarking in v5.9 (faster, but not as accurate timing (--timer INEXACT):
(cpu_benchmark_count and amplification_int are long long int)
auto b_start = std::chrono::high_resolution_clock::now();
auto b_end = std::chrono::high_resolution_clock::now();
while ((std::chrono::duration_cast<std::chrono::seconds>(b_end - b_start).count() < 1))
{
// Clear previous value and reuse the allocated space
process_intention.clear();
// Append the fixed part and the changing part
process_intention.append(intention_value);
process_intention.append(to_string(iterations));
cpu_benchmark_count++;
b_end = std::chrono::high_resolution_clock::now();
}
// Benchmark ends here
if (amplification_int > cpu_benchmark_count) // Make sure the amplification doesn't exceed the benchmark
{
amplification_int = cpu_benchmark_count;
}
do
{
start = std::chrono::high_resolution_clock::now();
end = std::chrono::high_resolution_clock::now();
while ((chrono::duration_cast<chrono::seconds>(end - start).count() < 1))
{
for (unsigned long long int i = 0; i < amplification_int; i++)
{
// Clear previous value and reuse the allocated space
process_intention.clear();
// Append the fixed part and the changing part
process_intention.append(intention_value);
process_intention.append(to_string(iterations));
}
iterations += amplification_int;
end = std::chrono::high_resolution_clock::now();
}