Animenosekai / translate

A module grouping multiple translation APIs
GNU Affero General Public License v3.0
525 stars 60 forks source link

add: new size based LRU cache & minor fixes #76

Closed ZhymabekRoman closed 1 year ago

ZhymabekRoman commented 1 year ago

Closes #58

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
translate ❌ Failed (Inspect) Jun 27, 2023 0:44am
ZhymabekRoman commented 1 year ago

Hmmm, test freezes.

ZhymabekRoman commented 1 year ago

So 100 threads seems to be too much for a single-core machine. There are two solutions: use gevent, or use parallelism. I don't know what solution will be eligible for translatepy.

Animenosekai commented 1 year ago

So 100 threads seems to be too much for a single-core machine. There are two solutions: use gevent, or use parallelism. I don't know what solution will be eligible for translatepy.

This is weird since Python should really allocate threads if it can

ZhymabekRoman commented 1 year ago

@Animenosekai, So even with a 1 thread pool, Github CI just hangs (link). Maybe we should use asyncio for lru_cache?

Animenosekai commented 1 year ago

@Animenosekai, So even with a 1 thread pool, Github CI just hangs (link). Maybe we should use asyncio for lru_cache?

Do you really think it hangs because of the ThreadPool ? Seems weird that GitHub Actions have issues with such a common object

ZhymabekRoman commented 1 year ago

Do you really think it hangs because of the ThreadPool ? Seems weird that GitHub Actions have issues with such a common object

I probably came to the wrong conclusion, in fact I did set the thread pool size to zero and there were no changes to the hangs.

ZhymabekRoman commented 1 year ago

Test hanging is fixed!