给定一个可以随时间演变其版本和分支的实体(例如文件或库/包),寻找优化的数据结构,让我可以通过版本导航到实体的特定实例。
例如(有点做作的例子)给定条目,例如:
MySIMDIntristicsLib.v1~archMIPS.v1~fbsd.v1
MySIMDIntristicsLib.v1~archMIPS.v2~fbsd.v1
MySIMDIntristicsLib.v1~archX86.v1~win.v1
MySIMDIntristicsLib.v1~archX86.v2~win.v1
MySIMDIntristicsLib.v1~archX86.v2~win.v2
MySIMDIntristicsLib.v2~archX86.v1~win.v1
// get latest across all branches
get( Entity="MySIMDIntristicsLib", branch[(latest) "~"] )
returns: "MySIMDIntristicsLib.v2~archX86.v1~win.v1"
// get latest across archMips/fbsd branch
get( Entity="MySIMDIntristicsLib", branch[(latest) "archMIPS~fbsd"] )
returns: "MySIMDIntristicsLib.v1~archMIPS.v2~fbsd.v1"
// get earliest for archX86 v2 branch
get( Entity="MySIMDIntristicsLib", branch[(earliest) "archX86.v2~"] )
returns "MySIMDIntristicsLib.v1~archX86.v2~win.v1"
我怀疑已经存在类似的东西(因为包管理或源代码管理利用类似于上述访问语义)。
我一直在寻找具有良好最新/最早访问时间以及下降插入/删除速度的上述内存数据结构。
在残酷的强制方法中,我认为可以 为每个可以有版本的分支使用Min Max heap来实现上述内容。
但是,可能已经有更好的东西了。我还检查了我通常的这些类型的东西的来源,Redisson——但没有看到是否有上述数据结构的显式实现
上面的 DSL 是我自己构建的,可能也有一些漏洞,所以如果有更好的 DSL/API 用于这种数据访问——也想学习。