cetz
cetz copied to clipboard
Can the program performance be optimized?
Can the program performance be optimized? There are too many loops. Are the following two pieces of code repeated?
for value in line-data {
if x-domain-min > value.at(0) {
x-domain-min = value.at(0)
}
if x-domain-max < value.at(0) {
x-domain-max = value.at(0)
}
if y-domain-min > value.at(1) {
y-domain-min = value.at(1)
}
if y-domain-max < value.at(1) {
y-domain-max = value.at(1)
}
}
I hope it can be improved. The clipping algorithm is quite naive. If you can find any perf. Improvements, feel free to open a PR. Currently, I do not have the time to do it.
I've been looking at the code for a few days, but I still don't understand it very well.
I've added some minor performance improvements with #814.