Skip to content

Conversation

@jefferis
Copy link
Collaborator

see also #521

* and doesn't have to be coerced to one either
* for testing, provide arg to switch between new
  and original algorithm

> bench::mark(coord2ind(m, testImage), coord2ind(m, testImage, use.scale = T), min_time = 3)
# A tibble: 2 × 13
  expression      min median          `itr/sec` mem_alloc           `gc/sec` n_itr  n_gc
  <bch:expr>   <bch:> <bch:>              <dbl> <bch:byt>              <dbl> <int> <dbl>
1 coord2ind(m… 63.7ms 73.4ms 1.16106306906514e1     252MB 2.25577967704085e1    35    68
2 coord2ind(m… 56.3ms 62.8ms 1.39956214910579e1     206MB 2.13266613197073e1    42    64
> bench::mark(v1=coord2ind(mdf, testImage, version=1), v2=coord2ind(mdf, testImage, version=2), v3=coord2ind(mdf, testImage, version=3), min_time = 1)
# A tibble: 3 × 13
  expression     min median          `itr/sec` mem_alloc           `gc/sec` n_itr  n_gc total_time
  <bch:expr> <bch:t> <bch:>              <dbl> <bch:byt>              <dbl> <int> <dbl>   <bch:tm>
1 v1          82.9ms 90.2ms 7.93571545940208e0     298MB 1.78553597836547e1     8    18      1.01s
2 v2          68.6ms   80ms 9.53099788536415e0     252MB 1.90619957707283e1    10    20      1.05s
3 v3          48.6ms 60.1ms 1.44604097192445e1     172MB 1.9280546292326 e1    15    20      1.04s
# ℹ 4 more variables: result <list>, memory <list>, time <list>, gc <list>
* empirically t_tx_OP_y seems to be better than scale
  (benefit is more limited with data.frame input mind you)
* the final version is ~ 40x more memory efficient and 10x faster than the original implementation
* just a convenience for running tests interactively
CMake Error at CMakeLists.txt:38 (CMAKE_MINIMUM_REQUIRED):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
* with example and some additional checks
* and add matrixStats to imports
@jefferis jefferis force-pushed the feature/efficient-coord2ind branch from 08eee54 to beae426 Compare October 14, 2025 14:57
* v0.2 is now merged to master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants