# Increased processing time on Weaviate v3 to v4 migration

**URL:** <https://forum.weaviate.io/t/increased-processing-time-on-weaviate-v3-to-v4-migration/3235>\
**Category:** Support\
**Tags:** python\
**Created:** [July 31, 2024, 10:03pm UTC](https://forum.weaviate.io/t/increased-processing-time-on-weaviate-v3-to-v4-migration/3235 "2024-07-31T22:03:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nancy\_Viviana\_Espino](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/nancy_viviana_espino/32/1570_2.png) [@Nancy\_Viviana\_Espino](https://forum.weaviate.io/u/Nancy_Viviana_Espino)\
**Post date:** [July 31, 2024, 10:03pm UTC](https://forum.weaviate.io/t/increased-processing-time-on-weaviate-v3-to-v4-migration/3235/1 "2024-07-31T22:03:53Z")

</div>

DescriptionGood morning, everyone!

I recently migrated from Weaviate v3 to v4 and made some adjustments during the process. However, I’ve noticed that processing times in v4 seem to be longer compared to v3 for the same files.

Has anyone else encountered this issue? I would greatly appreciate any recommendations for best practices or tips on how to validate and improve processing times. Your insights would be invaluable as I work to optimize performance.

Thank you very much for your help!

weaviate-client = 4.7.1  
version=1.24.9

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [July 31, 2024, 10:10pm UTC](https://forum.weaviate.io/t/increased-processing-time-on-weaviate-v3-to-v4-migration/3235/2 "2024-07-31T22:10:33Z")

</div>

Hi Nancy!

Welcome to our community 🤗

I believe you have the same Weaviate Server version (for instance 1.24.9) for both the v3 and v4 clients, right?

Can you share the code you are using for both clients?

the python v4 should deliver significant improvements as it leverages GRPC instead of pure REST.

Ps: the latest in 1.24.X is 1.24.21 as I write. We strongly recommend keeping it updated to avoid any of the known issues of previous versions.

Thanks!

---

<div class="post-metadata">

**Author:** ![Nancy\_Viviana\_Espino](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/nancy_viviana_espino/32/1570_2.png) [@Nancy\_Viviana\_Espino](https://forum.weaviate.io/u/Nancy_Viviana_Espino)\
**Post date:** [August 5, 2024, 2:17pm UTC](https://forum.weaviate.io/t/increased-processing-time-on-weaviate-v3-to-v4-migration/3235/3 "2024-08-05T14:17:25Z")

</div>

The process we mainly use consists of doing this

```auto
with ProcessPoolExecutor(mp_context=mp.get_context("spawn")) as executor:
    for post in collection.iterator(include_vector=False, after=cursor, return_properties=columns_to_retrieve):
        ... # get post filters
        post_requests = {
            "uid": str(post.uuid),
            "weaviate_post_id": post.properties["weaviate_post_id"],
            "where_filters": rel_filters_cache[rel_filters_combination],
        }
        batch_posts.append(post_requests)

        if len(batch_posts) % batch_size == 0:
            res = vector_db.process_batch_posts(batch_posts, max_recommendations, executor)

```

Inside the process\_batch\_posts what we do is with executor.map(partial(…)) to get the closest ones by batch. For this what we do is

```auto
weaviate.connect_to_local(
        # Avoid timeouts by setting one minute
        port=DEFAULT_PORT,
        grpc_port=DEFAULT_GRPC_PORT,
        additional_config=AdditionalConfig(
            timeout=Timeout(init=60, query=60, insert=120), # Values in seconds
        skip_init_checks=True,
        ),

    ) as thread_client:
collection = thread_client.collections.get(collection_name)
ann_result = collection.query.near_object( # type: ignore
            near_object=post_uid,
            limit=n_neighbors,
            return_metadata=MetadataQuery(distance=True),
            filters=filters,
            return_properties=["weaviate_post_id"],
        )

```
