Cursor与AI插件在复杂任务下的对比

Introduction

之前一直想尝试Cursor,有各种事情耽搁没做,正好周末有时间,把Cursor装起来体验了一番。因为我之前已经比较频繁使用AI代码插件,这次正好一起对比下;我之前主要是使用VS Code的Continue,多用于写一些小的脚本,发现插件使用起来效果也都不错。这次对比,主要是针对更复杂和更高级的任务,看哪一个表现更好;

先说结论,Cursor的使用体验确实要好过AI插件一大截,基本上是0和1的区别; 我的测试方法如下,找一个开源的项目,问一些全局的,高层的问题,看哪个回答的更好;我选用的代码库是libaom,它是AV1的编码器,非常复杂;很适合测试这个任务;对于Cursor,使用的大模型是Sonet 3.5,

问题设计

我问了一下三个问题: 1. Which function is the entry points for partition search? 2. 哪一个文件主要用于做global motion的搜索? 3. 哪一个文件用来控制不同的速度档次下打开或者关闭某些快速算法? 可以看到,这三个问题是非常high-level的问题,并且我没有给出具体的Context,所以要靠Cursor或者Continue插件自己来建立合适的Context;

Cursor

对于问题1,Cursor的回答如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Let me search through the codebase to find the entry points for partition search in AV1.
**Search codebase for "partition serach entry point cuntion av1 encoder". No results found**
Let me try a more specific search using grep to find partition-related functions.
**Grepped codebase for "rd_pick_partition"**

Based on the search results, I can identify the main entry points for partition search in AV1. There are two primary functions:

1. av1_rd_pick_partition() - This is the main rate-distortion (RD) based partition search function, located in partition_search.c. This is used when RD optimization is enabled.

2. av1_nonrd_pick_partition() - This is the non-RD based partition search function, also in partition_search.c. This is a faster version used when RD optimization is disabled.

Let me get more details about these functions to provide you with a better understanding.
**Read partition_search.c L5457-5674**
The main entry point is av1_rd_pick_partition() in partition_search.c. This function performs a thorough rate-distortion optimization to find the best partition structure. It's used when quality is prioritized over encoding speed. The function signature is:
其中**中间的内容是Cursor执行的动作,从这里面可以看到,Cursor会做对应的代码搜索,找到相关的内容,给出进一步的解释;这里面Cursor搜索的结果非常令人吃惊,因为我并没有给出具体的函数名字,例如rd_pick_partition,而是近似的名字"partition search",他还是准确找到了相关的函数;

对于问题2, Cursor的回答如下:

1
2
3
让我帮你找一下与global motion搜索相关的文件。
**Searched codebase for "global motion search".**
根据搜索结果,我可以看到主要用于global motion搜索的文件是av1/encoder/global_motion_facade.c。这个文件包含了全局运动估计的主要实现。让我解释一下关键部分:
同样,Cursor精确地找到了相关的文件,并给出了对应的解释;

对于问题3,Cursor的回答如下:

1
2
3
4
5
6
7
8
9
10
11
12
让我搜索一下与速度档次和算法控制相关的代码
** Searched codebase for "speed settings control algorithm enabled disable" **
根据搜索结果,我发现在 av1/encoder/speed_features.h 和 av1/encoder/speed_features.c 中定义了控制不同速度档次下算法开关的代码。主要的控制结构如下:

在 speed_features.h 中定义了多个结构体来组织不同类型的速度特性:
HIGH_LEVEL_SPEED_FEATURES: 高层速度特性
FIRST_PASS_SPEED_FEATURES: 第一遍编码的速度特性
PARTITION_SPEED_FEATURES: 分区相关的速度特性
MV_SPEED_FEATURES: 运动估计相关的速度特性
INTER_MODE_SPEED_FEATURES: 帧间预测模式相关的速度特性
INTERP_FILTER_SPEED_FEATURES: 插值滤波器相关的速度特性
INTRA_MODE_SPEED_FEATURES: 帧内预测模式相关的速度特性
可以看到Cursor不仅找到了对应的问题,而且把相关的文件和结构体都列出来做了总结;

Continue.dev:

使用同样的Claude 3.7 Sonnet的模型,问了同样的问题,只是我在chat 中手动添加了@codebase,希望能给一些提示;但等了很久没有反馈,一直显示"Generating";

之后我尝试选择"Agent" mode,还是同样的结果; 我检查CPU使用率,发现VS Code确实有在运行,我怀疑是在database中做矢量搜索,可能本地检索太慢,一直没有返回相关的context给大模型做生成;

我也有尝试使用本地Ollama的模型,但本地模型context比较有限(qwen3大概40k),非常容易超出context的限制;

Aidar

Aidar有去使用repo map,根据tree sitter会对整个代码库做解析,理论上应该会更好;让我们来试下:

1
2
3
4
5
export ANTHROPIC_API_KEY=xxx
aider --model anthropic/claude-3-5-sonnet-latest
# Enter the command line of aider
/chat-mode ask
Which function is the entry points for partition search?

Aidar的动作是:

1
2
3
4
5
**Update repo-map**
From the files shown so far, I cannot definitively determine the main entry point for partition search. While I can see
references to partition-related code like partition_search_type and variance_partition_alloc(), the actual partition search entry
point is likely in files that haven't been shared yet.

有意思的是,Aidar会持续要求加入一些新的context,例如一些文件,但看起来最终没有找到相关的函数; 看起来即使有repo map,但Aidar的能力也还是要差不少。