cetz icon indicating copy to clipboard operation
cetz copied to clipboard

Can the program performance be optimized?

Open sky126 opened this issue 1 year ago • 3 comments

image

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)
    }
  }

image

sky126 avatar Oct 24 '24 11:10 sky126

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.

johannes-wolf avatar Oct 25 '24 12:10 johannes-wolf

I've been looking at the code for a few days, but I still don't understand it very well.

sky126 avatar Oct 25 '24 13:10 sky126

I've added some minor performance improvements with #814.

johannes-wolf avatar Feb 24 '25 15:02 johannes-wolf