Duplicating a group of verticies takes O(n) time for each group.

Basic structure of code:


for i in range(50):
    for j in range(50):
        Select a group of verticies.
        print(timeit.Timer("bpy.ops.mesh.duplicate()", "import bpy").timeit(1))
        move verticies to a grid position based on i and j

The problem is that, running the timer on the duplication operation conditionally every n iterations, I see that it is taking longer and longer each time to do the duplication!!
I’m assuming this isn’t a bug in my code since its quite clear what the timer is actually timing. Should I just give up on the project until bmesh goes production?? What operation could I use that DOESN’T have O(n) runtime? Here is output from the real version of the above pseudocode.

0.00010332581563612985
9.53531446765514e-05
0.00012437366696941773
0.00016232358073700603
0.00018974956883795885
0.00022323478686818443
0.00025416875019133867
0.0002882917818983477
0.00031954465205988325
0.00036482942311030775
0.0003960822932718433
0.0004442372258676719
0.00048824636956454337
0.0005411849047361472

0.006704059556490449
0.00691421916298296
0.0069850164811064985
0.007896133318364917
0.007150210223390019
0.008029755283647688
0.007136816136178226

I was able to get around the problem by tree structuring duplicates. Duplicate 64 objects, pass them off to a new mesh, duplicate 64 more, new mesh. Amusingly the process of creating a new object/mesh also takes O(n) time as far as I can tell, but combining the two I can sneak by.